I bought a bag of Brussels sprouts that looked fine but smelled exceptionally bad, even for sprouts
What you are describing is what we call a food that has "soured". (This is what I was taught growing up.) The food looks and feels perfect but has that awful sour odor. 

In my experience it is from improper storage, usually from foods being kept too warm or not getting enough air circulation. (Not necessarily by you, but somewhere along the transport chain.)

I have found it in both Brussels sprouts and broccoli. I have even bought broccoli, used some of it, and later taken the rest out only to find it soured. Or bought Brussels sprouts and kept them for a couple of days before using and found that they had soured. This says to me that the souring process had already started.

Additionally, I have had it happen with fresh corn that was left on my porch in warm weather.

I have also found it in bagged salads and spinach. With those, a good washing and fresh air sometimes gets rid of the odor - but not always.

Unfortunately, we don't always know how foods have been handled and stored before we buy them.

I have searched extensively to find out more about this, to no avail. I can find information about how to tell if food is going bad or rotting, but this is a totally different thing. You have no way of knowing that this souring process is happening. That is, until you smell it.