Facing Hubert Hurkacz on a tennis court is about as annoying as it could get because his playstyle will leave you frustrated fairly quickly. If you're Andrey Rublev that's going to be even worse because the Russian has a tendency to get frustrated when the match is not going his way.
Shanghai favours players like Hurkacz who have a powerful serve and the serve proved crucial in this match. Rublev was the better player in most rallies, it's just that the match rarely featured any long rallies where he could display that. Ultimately it ended in a tiebreak which Hurkacz won largely thanks to his serve.
Because of the tiny margins in the match, Rublev was very nervous and on the edge for much of it. He grew increasingly frustrated as the match went on and when he threw away a 40-15 lead in a game down 4-5 to make it advantage Hurkacz he lashed out.
In the point, Rublev was distracted by a photographer, and after losing it and giving Hurkacz a match point, the Russian lashed out at the reporter in a pretty excessive way. You can understand the frustration, but this was a bit over the top, which the umpire conveyed to him after giving him a code violation.
Rublev protested, and the umpire was sympathetic to it but ultimately pointed out that it was too aggressive as Rublev not only lashed out he was walking toward the photographer when he lashed out. That rage helped him though, as he reeled off three amazing points to win the game, but ultimately he didn't win the match.
Check out the video of the outburst below.