I don't think the following is involved in your main problem but it should be of interest.
From page 18 of the UC400ETH manual,
Ethernet communication is isolated and power is not transmitted on the network on the
ethernet cable and therefor the UC400ETH board needs an external 12 to 24Volts DC
powersupply to be connected to the plug type green 2 pole power terminal on the side of the
board.
I am assuming you have the LPT-CNC-H plugged into the UC400ETH.
This would seem to say that the opto-isolator board is redundant unless you are isolating the 2 UC400ETH ports from each other.
Also the schematic of the LPT-CNC-H opto board show the earth and ground, and the +5V and VDD5V are jumpered together by zero ohm resistors R30 and R31.
Unless those resistors are removed and two separate powers used, the board is just a buffer.
The power-in terminal called 9V to 12V on some documentation and +24 on the schematic connects to a voltage regulator that provides 5V to the PC side of the circuit. The earth terminal seems to be associated with that supply input, you could verify this by using an ohmmeter to show a connection from the earth terminal to an earth pin on the DB25 connector.
The IO to the machine is powered by the VDD5V terminal and probably the GND terminal. There is no regulator on this side so you would need to connect to a 5 volt supply.
I think you could remove the opto board and run successfully. If you want isolation between the stepper drives and the rest of the IO then you would have to take the steps mentioned above.