Factory reset but backup your photos and videos or anything else you want to save first. When doing so, put them all through a virus scanner. It's highly likely your phone and connected accounts on it are compromised given the behaviour and passwords not being recognised.
It happened to my galaxy s20 5G after the software update my phone still not right now. Software update affected a lot of Samsung disgruntled customers, but Samsung denied there was anything wrong with the software update. Hope you resolve this issue