OCP\Lock\LockedException: "/user.name" is locked

Looking at the whole error I saw that it failed to create the user data folder. At first look it did create the folder but later when I looked inside it the folder files was missing, so I created it and scanned that users files with “occ files:scan username”. This fixed the problem for me.