I've run into this a couple times, and in the past I just rebuilt the RM rule, but that is an obvious pain.
The issue I'm having is if I create a RM with a trigger, action and condition that references a device, and that device gets deleted, this is what happens:
Trigger: Automatically removes the invalid trigger
Action: Displays Broken Action, which you can manually delete and replace
Condition: Has a stray "FALSE / TRUE", but no reference to the invalid condition. When you click into the conditions, it isn't there, so you cannot delete it.
This invalid condition shows up on the edit rule screen (in the bottom), but not when you click on the conditions to edit them directly. Any idea how to clean that? I'm concerned that it will lead to some sort of corruption.