Hell Apple has given me problems for infringing on my own trademark- accidentally registered an app under the wrong developer account and tried to just delete and recreate under the correct one, took multiple rounds of review and having to file my own trademark complaint for them to allow me to use the name again. Great way to get stuck in App Store Hell
I have not done it, but I think there’s a way to transfer published apps.
I have, however, made the same mistake as you. I work under three different organizations, and can miss which one I have selected (also, Apple is constantly randomly changing the initial one I am logged into). In that case, it was just at the start of development, and I could easily change the bundle ID.
I have transferred published apps before, and was hoping to avoid bringing Apple into the loop to transfer my own app to myself or deal with the absolutely ancient interfaces still in place for that process since this app hadn't been published. Lesson learned the hard way, jump through the Apple hoops or get the stick.