Hi Harsh,
This error probably pops up because your input doesn't match the settings as shown in your App Security Settings > Password policy tab.
If the entered password doesn't match the above settings, an error will be shown just like in your example.
Hope this helps.