Doing the same action over a long period is how a habit develops. Users develop a habit when they type in their password to log in. But this habit can cause unexpected login errors after they change their password.
Users can get so used to typing in their old password that they forgot they changed it. When they get an error message, they’re led to believe they’re typing it in wrong. This leaves them frustrated and confused.
Typing in their new password isn’t a habit yet. What users need is a reminder of their recent password change. Instead of giving users a wrong error message, tell them how long ago they changed their password. This will help them realize why logging in with their old password is failing.
The reminder message should only appear when they type in their old password. If they mistyped a password, it should display a wrong error message. This means you have to store the old password hashes to detect when the user types in their old password.
You may expect users to remember they changed their password, but old habits die hard. Password typing habits can stick with users until they make a conscious effort to change. Help users form a new password habit by turning that error into a reminder.