Tags are not guaranteed to be stored nor returned in order. You cannot count on the first tag always being at index 0 and the second one always at index 1.
This problem is really outside the bounds of what tags are intended for and will not really work that well for you. A better approach would be to use Item metadata but metadata isn’t available in Rules DSL.
It’s one of several reasons why I do not recommend Rules DSL for new development. Any of the other languages are just as easy to work in, do not have weird problems with type, and have full access to everything in OH. Even Blockly is more capable than Rules DSL.
But thankfully, you don’t even need an Item for this. You can install Thing Status Reporting [4.0.0.0;4.9.9.9] from the add-on store. This will be configured to call a rule when ever a Thing changes status. The called rule will get the thingID, old status and new status of the Thing. You can set up a condition to only look for OFFLINE states, only certain Things, only Things from a certain binding.
For example, a rule that only looks for MQTT Things going offline would look something like this (this is a JS Scripting and a UI rule, again, Rules DSL lacks the ability to be called from another rule with arguments):
Rule Condition:
thingID.startsWith("mqtt") && newStatus != "ONLINE";
This will only run the rule action if the thing ID starts with “mqtt” and the new status is anything but “ONLINE” (e.g. OFFLINE, error, etc.).
Rule Action:
console.warn("Monitoring Things Status: ThingID - " + thingID + " Status - " + newStatus + " Details - " + newDetails);
// add code to reset the binding or take what ever remedial behavior required
No triggers, the rule template will call this rule when any Thing changes status.