Generate: min length can't be larger than max length
# What does this PR do?

Adds a simple check, as described in the PR title.

Closes #16622 
_The documentation is not available anymore as the PR was closed or merged._