Wow, this is really helpful, I was looking for cause of the same issue everywhere, both gpt and muse failed to anwser, and yet you solve that, thank you!
Indeed, this is a known workflow issue. The reason this happens is because UI Toolkit expects UI to be created and bound in the OnEnable() call. This way, it will always recover (rebuild) when you disable->enable the MonoBehaviour or GameObject. More info here:
There’s a long story here, but a reason for this pattern is to enable fast iteration when making changes to your UI assets in the Editor (ie the UI Builder, but also text editor). When we detect changes, we artificially destroy the UI hierarchy and call OnEnable() again on your MonoBehaviour to regenerate the UI with the updated assets.
That said, it is ALSO good practice with UI Toolkit to not disable the entire GameObject whenever you want to hide UI and instead, either do what you did with visible, or use the display:none style. This will keep bindings up and also save you a lot of unnecessary allocations.