This issue may occur if the user profile was manually deleted by using the command prompt or byusing Windows File Explorer and if the “Do not logon users with temporary profiles” Group Policy ...
For example, to fix the User Profile Service failed the logon error, you can try restarting the User Profile Service, copying the default folder from another computer, etc.