If you log into Windows 10 or 11 and want to fix the error that the Task Host Window prevents the shutdown of Windows, you can try doing this:
Go to Start > Settings > Accounts > Sign-in options. Under Privacy, turn the second setting On if you want to use your sign-in info to automatically finish setting up your device after an update or restart.
However, instead of turning the setting On, turn the setting Off, and the issue should be resolved.
Good luck!