On turn 13 in this replay, Rillaboom uses Knock Off on Ferrothorn but the Rocky Helmet isn't knocked off. Is it because Rillaboom fainted?
If the user faints due to the target's Ability (Rough Skin or Iron Barbs) or held Rocky Helmet, it cannot remove the target's held item. However, Knock Off will still remove the target's held item if the user faints due to its own held Life Orb. If Knock Off causes a Pokémon with the Sticky Hold Ability to faint, it can now remove its held item.
Source
I also asked this in Showdown!'s Help room and got the same reply.
[22:53:47] @Think~?: Yes, it does. [22:53:49] %PartMan: If the Pokemon faints to damage while Knocking Off, it isn't knocked off, yeah/.
Hope this helps!