And yes, that's why coach's challenge exists. The linesman missed the call in real time, looked at the replay and realized he made the wrong call. So he reversed the call.
The rule is terrible. I get it. But the lineseman followed the protocol, and ended up getting the call correct.
Except they didn't if you go off of their own standards previously set on a goal scored against the Bruins so it wasn't the right call.