The token you have provided only has scope data:read, when checked using: https://jwt.io/. It looks like you have commented line #53 which gets the internal token. In this case line #52 gets the public token which has data:read scope that is not enough for getBucketDetails operation.
You may uncomment line #53 and verify on : https://jwt.io/ that our internal token has bucket:read scope.