Load order of JS files
The libraries are loaded by weight, not in the order they are defined.

You already had figured that out. You have set a weight of -400 for the external library. This will be the first library loaded, because in drupal the lowest weight for a library is -22. But most times you would want to be above -20, because this is the weight of jquery, on which most libraries depend.

The problem in your case is, that the library mylib.js is specified to be loaded in head. So the external library will never be able to come ahead. It's loaded at top of all other libraries because of the low weight, but still with the bunch of all the other libraries at the end of the document.