Booting into Safe Mode. Once in Safe Mode, you can try to create a new user account.
You can use System Restore to revert your system to a previous state where the user profile was working correctly.
Boot into Safe mode and go for a registry edit:
Press Win + R to open the Run dialog, type regedit, and press Enter.
Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList.
Look for a key with the name ProfileImagePath that corresponds to your affected user profile. Delete this key.
Restart your computer and log in again.
Check it here:
https://petri.com/user-profile-service-failed-the-sign-in-error/