in my case in my Windows app i had a StaticResource of type x:String used as GridLength for a Grid (i wanted to save value star (*) in the Resource Dictionary). Worked in Debug but crashed in Release at startup.
To find out where the exception is thrown it is necessary to add DEBUG constant to Release build in Project properties.
Then launch the app with debugger attached, the exception info will be shown.
Harry Smith's answer works too but just removes the error and not the cause.
As Rashid Khan wrote I also can't believe MAUI is in production.
I just logged in to Stackoverflow to share this solution, wasted 3 days on this.