Error message when user is locked

I was wondering if it's possible to show a different error message, when the user has entered to many wrong passwords (or any other reason) so the account has been locked.

Since the "Forgot password" option is not working anymore for those users, it would be key to help them with a specific error message.

I assume you mean on the login screen? In that case, you will have to create a custom login screen that provides that functionality.  I've done it for some customers before.