I'd think that adding a wire from the GND power return of the 4 CAN cable wires to the USB gnd at the CAN side would provide some safety since it would now be impossible to lose the ground connection without losing the data connections as long as the USB plug was inserted.
On the RPi side, if the 5v and 24v power supply grounds are connected together, the same should be true as the Pi USB ground should be connected to Earth and Power ground.
Better still would be to add suitable back to back zener diodes from each USB D line to ground. I don't know what the required breakdown voltage should be, but probably 6V would be close. I would think that both the EBB and RPi boards should have those diodes there already, if they were well designed!
I'd think that adding a wire from the GND power return of the 4 CAN cable wires to the USB gnd at the CAN side would provide some safety since it would now be impossible to lose the ground connection without losing the data connections as long as the USB plug was inserted. On the RPi side, if the 5v and 24v power supply grounds are connected together, the same should be true as the Pi USB ground should be connected to Earth and Power ground. Better still would be to add suitable back to back zener diodes from each USB D line to ground. I don't know what the required breakdown voltage should be, but probably 6V would be close. I would think that both the EBB and RPi boards should have those diodes there already, if they were well designed!