For reference: this works correctly under classic AmigaOS.
I tested it on 1.3, 2.1, 3.1 (ARexx 1.15) and 3.2.3, and all of them return the correct RC when running RX 42.rexx with a simple exit 42.
So the incorrect return code seems to be specific to the OS4 RX interpreter.
When you posted this back in June, I tried to reproduce it, but at first it seemed to work for me. Then I got sidetracked and forgot to do more investigation, sorry.
Now I tried some more, and I think I found a way to reproduce it.
Could you try repeating your test, but in the third step, instead of typing "RX 42.rexx", just type "RX 42".
Does that work correctly?
That's what I found here at least.
If you can confirm, I'll try making a bug report about it. Not sure which component exactly is at fault, though, nor when/if it can be fixed at all in the old ARexx code, but at least we will know the workaround: Omit the .rexx suffix when invoking an ARexx script file (it is optional after all). Yes, I know, crude, but still ...
Oh, and @FlynnTheAvatar: I would be curious to know whether the same difference is present in the classic version. Your comment above seems to indicate it's not, but could you please verify again?