Switching between entirely different and separate "UI personalities" could work.
I don't think the pointer vs touch UI is the main thing that people have in mind when wishing for macOS on the iPad though, instead a "proper" UNIX-style filesystem and shell, and the ability to install any software outside the app store via a package manager and without Apple's nanny reflex getting in the way.
Apple is very clear about their product differentiation and would never make macOS and ipadOS exact copies. Case in point: when they brought cursor support over, they painstakingly engineered it to work differently and snap to objects on the screen. I think if they did OP's suggestion and had a macOS screen show up when an iPad is connected to peripherals it would actually work out well.