[2.2] Fix error message with maximum amount

Fixes #6567