The correct error message is now added in the below open PR
https://github.com/discourse/discourse/pull/9643
P.S. merged