ResourceLoader dependencies are not always reliable in debug mode. This generally pops up when a module from the top queue depends on a module from the bottom queue, or with the custom-hacked private embedded modules. Examples from the past include T36542, T49457, T102718.
I think it all comes down to this bit in mediawiki.js, addScript() function:
document.write( mw.html.element( 'script', { 'src': src }, '' ) ); if ( callback ) { // Document.write is synchronous, so this is called when it's done. // FIXME: That's a lie. doc.write isn't actually synchronous. callback(); }
Like the FIXME says, document.write isn't actually synchronous, and therefore dependent modules sometimes execute before their dependencies are loaded.