What I noticed is that any new application, like Terminal, new Notepad, TaskManager, even Settings (Start Menu | Settings) opens and closes in seconds, reinstalling only Microsoft.UI.Xaml downloaded from any app with your script, it solves the problem.
The other way is to update Windows before...