I noted this too: Spurious failed routing engine from some JunOS devices
jnxFruSlot should be queried to get the valid slot numbers in jnxFruTable - Juniper have this documented for the MX and EX9600, and I’ve found it true for the QFX and EX’s I have (slot number is negative for invalid RE’s).
The old code worked because it filtered out known bad entries - a missing RE will always be called “Routing Engine”, but a present one will be called “Routing Engine X”.