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.