Strange, I wouldn’t expect it to result in what you showed! Good thing to remember if someone else runs into a similar problem, and it might help in creating a minimal repro case… Anyway, nice find and good that you managed to solve it!
If you’re using layers to control render order in the ui you need to understand the implications when it comes to draw calls and draw order. Incorrect layer assignment can break batching and increase the number of draw calls. Not assigning a layer means that it’s inherited from the parent node.