I know you've already answered this yourself, but for me the better solution was to create a Node2D element and child the UI elements to it. I did this because the Node2D has a z property and it can be hidden or shown at my discretion which the CanvasLayer didn't. Useful when you want to show menu panels i.e. pause menu.
The problems I found with the CanvasLayer is that it can't be hidden and if you display a panel over it, all of its children elements disregard your sort order and still show over eveything.