If the phone is locked via its security protocols then there isn’t an easy way of resolving this.
If you use Google Search you can find ways of possibly unlocking the phone by following resets of your security passwords etc.
Failing that when I Factory Reset my s7 edge for some reason the phone wouldn’t accept my Google Password so I took the phone to my Local Samsung Experience Store where they Reset this for me.
You may need to follow that route.
Current Phone ~
Samsung Note 20 Ultra 5G SM-N9860_256Gb SnapDragon 865+
Samsung One Ui 2.5/ Android 10.