I had the same problem. Windows 11 Pro v23H2.
What worked for me was this:
- Download this file: https://download.microsoft.com/download/8/e/f/8ef13ae0-6aa8-48a2-8697-5b1711134730/WPJCleanUp.zip
- Go to Downloads folder and unzip "WPJCleanUp.zip"
- Go to the folder v2004
- RIGHT-click on the file called "CleanupWPJ_X86.exe" and left-click on "Run as Administrator"
I could not tell you specifically what the file called "CleanupWPJ_X86.exe" does, but it definitely removed the unwanted Work or School Account from my personal laptop. Nothing else I had tried, had done any good at all.