@steve123

I suggest the constant reloading might not be intended or desired.

Right, but you provoke this behaviour with three methods:

define a pin which is triggered on both edges (up and down) test for that event immediately after defining it in config.g couple this with a reset of RRF (which presumably leads to a signal change of the pin on reboot)

First thing to note: you should not check the trigger in config.g with M582.

Second, you need a well defined signal to trigger an event: What level do you expect io8.in to represent if your switch is "open", i.e. disconnected? High, low, or something in between?
To overcome this issue, it is good practice to activate the pull-up of the pin and then switch to GND. This has the additional effect that you now only have to check the trigger signal on the falling edge.

Third, I strongly recommend not to trigger such a fundamental event directly. If you invoke a macro (which in turn calls M112), you can take optional measures against repetitive stops (i.e. implement a global variable), in case you encounter a similar behaviour as now.

Put something like this or similar into config.g:

M950 J0 C“^io8.in“ ; define io8.in as input pin 0 (P0), activate pullup (normally high) M581 P0 S0 T3 R0 ; call macro „trigger3.g“ if button pulls P0 to GND

Create the macro "trigger3.g" in the /sys directory:

; trigger3.g - Emergency Stop M112 ; do it

Note of caution: Usage is at your own risk. Untested, my Duet is currently out of reach.