NBA referees haven’t exactly been showering themselves in glory this week.

On Tuesday, the officials in the Houston Rockets-San Antonio Spurs game ruled that James Harden’s very obvious dunk was not a dunk in a double-overtime game Houston would lose by two points. And on Wednesday, they missed LeBron James walk the ball up the court in the truest sense of the phrase.

Even James couldn’t believe that his 3½-step first-quarter stroll without dribbling wasn’t called, telling ESPN that it probably was “one of the worst things I’ve ever done in my career.” He explained that he had gotten distracted by a collision under the basket between Kentavious Caldwell-Pope and Donovan Mitchell.

“I think at the same time, I was watching the underneath play, and KCP and Donovan got into it. KCP started to run, and Donovan bumped into him. He fell on the ground,” James said. “I think I was ready to pass the ball, and my brain just kind of just — I had a malfunction. I really had a malfunction.”

James and NBA referees have long had a somewhat frosty relationship, going back to the days when the referees first had to interpret the legality of his “crab dribble.” In 2018, he chided them for protecting jump-shooters more than players who drive to the basket. Following a game last season in which the Oklahoma City Thunder’s Russell Westbrook was awarded three late free throws even though replays showed he was fouled before shooting, James took to Twitter to express his displeasure:

But after he wasn’t caught red-handed Wednesday night, James said he hopes the league goes easy on the officials for missing the call.

“I feel bad for the refs on that one because they’ll probably get a write-up on that or something,” he said. “That was pretty bad.”

As for the refs’ previous faux pas this week, ESPN’s Tim MacMahon reported Wednesday night that the Rockets will likely file an official protest with the league over Harden’s not-counted dunk to ensure that the NBA investigates (even though that probe already had begun, MacMahon said). League rules state the team had 48 hours to lodge the protest. MacMahon also reported that the NBA is unlikely to simply award the win to the Rockets, as they have desired, with the game more likely to be replayed from the moment of Harden’s dunk.

More NBA coverage from The Post: