Actually, perlrun says the same thing under the handling of the -M parameter. But in fact, it is just the string STDOUT being passed to the pragma, even in the program. To pass the filehandle (in a simple way, without using lexicals or other modules), you would usually pass a reference to the glob, as in:
# WRONG use of encoding pragma, just an example
use encoding 'utf16', \*STDOUT, 'utf8';
But anyway, as to the true source of the problem, I gave up trying to figure it out, as noted in the update.