Maybe so, but if they don't know they can't succeed then IMO the roll should happen anyway; and only on a nat. 20 should they realize the task is in fact beyond them.
Unless it's something obviously ridiculous, I do the same. If I tell someone they can't succeed then the player knows without a doubt it's impossible. Sometimes I don't want to reveal that without an attempt.