Hi Babacar
Than the problem is that SSH-ing from a PC introduces even more latency into the pipeline, which is not there when running the CM4 on its own (what it's designed for). I suggest you to view the latency measurements using getTimestamp() on frames on the RPI and check the those values instead of looking at the camera feed which will depending on the image size (and ETH connection) introduce even more latency - possibly the largest portion of it.
Here are some examples:
https://docs.luxonis.com/projects/api/en/latest/samples/host_side/latency_measurement/
Thanks,
Jaka