There's at least a handful of times when the artificial gravity fails: in TUC (when Kronos One was attacked), and in the VOY episode "Prey"(?), when Species 8472 presumably causes some damage, as well as in episodes of ENT and DISCO. Relatively rare compared to the other malfunctions though. In RL of course it's a budget item if they portray that, but in-universe we could postulate that it's the kind of thing where even if the artificial gravity generators are damaged there aren't instantaneous effects.