When I read the title, the first thing I thought of was hara-kiri!
Actually, Djokovic did pretty much the same thing you're suggesting not once, but 3 times!
1) 4 or 5 years ago was the summer of migrants pouring into Europe from Mideast and NAfrica. In one press conference, Djokovic came out and said those refugees should be able to find a home in Europe. That attitude was very unpopular then, and is now, especially in the Balkans.
2) Before 2018 World Cup final between France and Croatia, Djokovic came out and said he support Croatia, partly because he's friends with many of their stars. He visited their training camp before WC, and had his picture taken with the team captain Modric and Rakitic. A prominent politician (mayor of Belgrade, I think) came out and said only crazy Serbians could root for Croatia.
3) His decision to take on Goran, a Croatian, as assistant coach was also very unpopular with a large segment of Serbians.