There's a bug/problem (as of 2/26/23 on VS 17.6.0 Preview 1.0) that this generates code that does not build if there are spaces in the project name. I think that should be allowed, or at a minimum, detect spaces and prevent the user from proceeding.
The spaces cause problems in numerous places. I suggest just repro'ing the problem yourself to see where.
Creating an app without spaces in the project name did work.
Confusingly, there were build errors (like MauiApp not being a namespace) on the first build, but the code still ran. Those errors persist in the Error List window while running, so I do consider this a "bug". So there's some weird build pass dependency and timing thing going on, albeit ultimately ignorable
Originally reported in the marketplace Q&A.