When I run this script in SQL Developer the autotrace output is weird. It looks fine in SQL*Plus:
. . .
Has anyone else seen this behaviour or have any clue how I might troubleshoot?
Do you plan to actually tell us what you think is 'weird' and what 'behaviour' you are talking about?
It's a bug. We're pulling in the wrong stats as the ID have changed and our code did not.
It's fixed in version 4.0 which is now available as an Early Adopter release if you want to check that out and make sure it's to your satisfaction.
We've also improved the feature a bit.