Windows 8 failed because it tried to merge desktop and tablet UI paradigms.
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.
So you're saying my Steam Deck, which has both a "game console" UI and a desktop UI mode and lets you switch between them, is somehow running two OSes? Weird argument.
I mean, their strategy was awful. They replaced the start menu for the first time with a whole-screen abomination that ruined power user workflows. They made the desktop TOO much like a tablet, it seemed like they wanted one interface for everything.
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.
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.