After getting the corrupted rule a few days ago, I split the logic into 2 rules and was re-creating them from scratch to try to ensure they weren't corrupted.
This time, I added all the if/else logic first and I now see that it has unexpected "ELSE" and "END-IF" options at the bottom as soon as I started adding other lines.
As you can see, it looks clean.
However, as soon as I added one line to the top, I got the unexpected ELSE/END-IF options:
I'm not sure if that means the new rule is corrupted already--or if this is just a glitch in the UI?
Given the disparity between the interface and the backend code, it's impossible to actually know if the "back end" rule is corrupted or not since it can look fine on the UI but still not work as expected in some cases.
Note about the original rule you indicated was corrupted and my first attempt to recreate things tonight, as well: when both rules were at about the point shown here....
Cancel Timed Actions: Dash In and Out-Initialize and Entry
IF (Variable DashInOutHSMMode contains 'Away') THEN
Set SetStateStatus to 'Setting HSM Away'
HSM Arm Away
Wait for Expression: HSM status is Armed Away
--> timeout: 0:05:00
ELSE-IF (Variable DashInOutHSMMode contains 'Home') THEN
Set SetStateStatus to 'Setting HSM Home'
HSM Arm Home
Wait for Expression: HSM status is Armed Home
--> timeout: 0:05:00
ELSE-IF (Variable DashInOutHSMMode contains 'Night') THEN
Set SetStateStatus to 'Setting HSM Night'
HSM Arm Night
Wait for Expression: HSM status is Armed Night
--> timeout: 0:05:00
ELSE-IF (Variable DashInOutHSMMode contains 'disarm') THEN
// Assume HSM is already disarmed and this was triggered by the Dash In/Out Switch being triggered while disarmed.
ELSE
Notify Rob's Pixel 6 Pro and Speak on Garage Sonos, Basement Sonos, Basement Bedroom Sonos, Master Bedroom Sonos, Kitchen Sonos (volume: SonosVolumeNormal): 'WARNING: Previous HSM status isn't known. Arming in Home mode.'
Set SetStateStatus to 'Setting HSM Home'
HSM Arm Home
Wait for Expression: HSM status is Armed Home
--> timeout: 0:05:00
END-IF
IF (Variable DashInOutRingMode = 'away') THEN
Set SetStateStatus to 'Setting Ring Away'
setMode('Away') on Ring Alarm Hub-Ring
Wait for Expression: Ring Alarm Hub-Ring mode away
--> timeout: 0:05:00
ELSE-IF (Variable DashInOutRingMode = 'home') THEN
That last "ELSE-IF" was originally corrupted somehow. It appeared something like "ELSE-IF(( FALSE)" before I deleted it and recreated the ELSE-IF (which seemed to work).
Because that was very much like what I recall from the original rule, I suspect that may have been where the corruption came from. So, I am re-creating this rule all over yet again. This time (starting with only the conditionals), I didn't see any corrupted conditionals--just the unexpected ELSE/END-IF options. I'm hoping those are just a UI glitch.