Don't you have pdf password enabled in the pdf utils somewhere?

This is disabled when running in studio so it behaves differently when running through API.