Oh, you haven’t read the food safety guidelines correctly. Not all foods are susceptible to quick bacterial or fungal growth and therefore need refrigeration to get them out of the danger zone. The fresh fruit and vegetables at the store are perfectly shelf stable for some time.
The reason why the cooked vegetables fall into “the 2-hour-max-rule” is that generally all cooked food are considered perishable. Just think of the lukewarm cooked food as a suitable breeding ground for whatever nasties happened to float in the air. The intact plant parts (root, fruit,...) are not.
A freshly harvested plant part is still alive to a degree, at least on a cellular level. Roots are able to regrow into plants if planted and fruit continue their ripening process. Even flowers (e.g. your broccoli) are, just think of them as cut flowers that open over days in a vase. The dying process leads to wilting, drying out or getting mushy - and the vegetable being unfit for consumption. The speed of this depends on the plant and the storage condition. If you choose to refrigerate your raw vegetables once you bring them home, you can slow it down: Just think of salad at room temperature vs. in the fridge.
When you cook the vegetables, you destroy cells and stop the cell metabolism - and make them suitable for bacterial growth. It’s also important to distinguish between safe and spoilt: it’s the possibility of bacterial or fungal growth that determines safety and the actual growth of them that determines spoilage.
So you can safely eat your raw broccoli, provided you wash it first and it’s in otherwise good condition, e.g. not mushy and mold-free.
1 Note that not all vegetables benefit from refrigeration.