I watched the video again, I think the ref is the one who made a mistake not to stop the game in the first place, that defender didn't know there were 2 balls, he instinctively kicked it after less than a second of visual exposure to the 2nd ball, I mean that would be his job as the defender on the defending side.
This is exactly the situation where tech like VAR is supposed to work to help the officials.