Hello,
I'm running into the exact same problem. When I try to add an account to my PC, I get stuck in an infinite login loop. Similarly, I can't log into Xbox due to the same issue.
This issue happened to me first roughly 2 months ago. I couldn't find any help online so I ended fully resetting my PC after several futile attempts to reinstall Windows 11. It fixed the issue, but as of yesterday I am running into it again. I don't want to reset my computer again, so I would greatly appreciate it if someone could help.