This is normal for men to have this dreadfull event happen at the worst times. I too have had it happen. Been at the swing club and the ladies make me hard on the dance floor or a great lap dance and then my dick don't work, but still feel excited.
Just the other night, the wife and I went to visit old friends when we came into town and hadn't seen them in a yr. Our female friend sat on my lap and got me hard and turned around to suck me off. It felt good. but the hardness was slowly going away because she said her son would be home in 3 mins. That took the mood away somewhat, but her husband had no problem when my wife was sucking away on him. So, overall the enviroment can do things to a man's body.......what pressures we have on us...lol.