I found that the loading screen (at least the preset one) is working poorly when I tried to toggle it on and off in quick succession (basically having engine.displayLoadingUI() and engine.hideLoadingUI() called quickly next to each other when applicable)
This is expected. JavaScript has only one thread so calling show, hide, show in a row will break the DOM system has it has to wait for the assets to be ready and animation to be completed.
This is mostly because of the transitionEnd event: