Hello!
There should be an easier way out than having to erase your Mac. Let's work through this and find the simplest solution.
First off, your Mac login is different from your Apple ID. If you happened to be using the same password for both your Mac login and your Apple ID (bad idea security-wise), keep that in mind when you are trying to enter your password.
Basically, if both your Mac login password and Apple ID password were P@ssword123, and then you changed your Apple ID password to P@ssword456, your Mac login will still be P@ssword123. Hope this helps … maybe I'm still not being clear!
If that didn't help, can you describe what you see, or post a photo of the screen your Mac is showing?
Thank you!