An IRF can't be deployed using Switches belonging to different Switch series (HPE 5900 + HPE 5940).
That one is a fundamental restriction which admit very few exceptions (and attempting to create an IRF using a 5900 and a 5940 together as candidate IRF members for the very same IRF fabric is not one of those ones). That is documented.
Sorry it is a no go, a deadend road.