I've very occasionally seen similar behaviour to this in the past - in fact it's part of the reason why we grey out the UI until pgAdmin is fully loaded.
Any idea what might be causing it?
This can happen, when the module is not yet loaded for the respective node, and it is being expanded.
Just thinking - shall we load all the javascript in the beginning?
That could be a lot of code, especially as the app grows. It may not be an issue in the runtime (though, some recent reports would imply otherwise), but it almost certainly would be on slower connections to installations running in server mode.
There must be a way to ensure the code is loaded before we allow it to be used?