I'll have to say it is a myth...mostly. Yes, that "threat" has been used by all sorts, but particularly religious leaders who want men to only use their cocks for procreation. To them, our genitals are not meant to be enjoyed for pure pleasure.
Now, to explain "mostly." It's usually because we crave variety that we may experience trouble getting and keeping a boner. But, there are the occasional complaints by men who have trouble ejaculating during penetrative vaginal sex. It can be typically attributed to a lack of stimulation. The glans (head) is the most sensitive part of the penis. But, if there is no friction against it, there isn't enough stimulation to get to a level of arousal for ejaculation.
The reason may be twofold: The amount of lubrication prohibits sensation, and/or the tightness surrounding the penis. Add his precum to his partner being too wet and....
When this happens, a man will either get frustrated and lose his erection, or pull out and use his hand to stroke himself with a firm enough grip
and enough stimulation to the head to achieve ejaculation
thus making folks believe that he can't cum with "regular sex."
With vaginal penetration, the issue of a man's partner being too wet can be solved. She can squeeze down each time he withdraws, and let up with each thrust. And he can squeeze his buttocks against the prostate when he thrusts. If that doesn't solve the problem for him, then there are simple OTC medicinal alternatives. Any anti-histamine, such as Benadryl, will assist in slowing down the secretions - for either partner.
A man needs the physical stimulation to remain hard and achieve orgasm. Not being able to ejaculate is not only frustrating mentally, it can result in a serious case of Blue Balls, sometimes referred to as Lover's Nuts. Through jacking off, he is able to provide himself with the proper amount of friction to cum.
Have you or a partner ever faced the difficulty of not being able to cum with the need to switch to masturbation?