Probably the least qualified person in this thread, but our electrician sorted almost the same thing in our boiler room, and Emily’s point is why yours sits at 9 V. Your 10k pull-up and 10k pulldown make the gate about 12 V, minus the threshold gives the source a bit under 10 V. The MOSFET is half on, so it gets warm.
His fix was to throw the MOSFET out. A PLC input like that only draws a few milliamps (ours was about 5 mA at 24 V, the manual says), and a PC817 transistor can switch that by itself:
Pi side: GPIO17 -- 330R -- PC817 anode (pin 1), cathode (pin 2) -- Pi GND
24 V side: +24 V -- PC817 collector (pin 4)
PC817 emitter (pin 3) -- PLC input I0.5
PLC input common -- 0 V
Opto on, the input sees close to 24 V. Opto off, nothing. Isolation stays. If you want something with a DIN rail clip and a label on it, a ready-made 24 V opto or relay module does the same.
On the Hermetry side he set the hold command as High impact so whoever sends it has to confirm. A board control won’t send a high-impact command though, so it goes from the device’s Commands tab. For a hold request that stops a line, we found that was fine.

