Confirming what Zlo said. The replay server receives replays and compares them to produce one replay. This is what you connect to and receive, exactly so that one player leaving early doesn't end the replay.
There has been what I think is a rare bug, where a live replay stops early. I have no clue what causes it. It does not happen to the replay saved on the server, and that comes from the same data. It happens in two different replay server implementations, Python and Rust. I think this might be something client-side, but I can never reproduce the issue on my end.