Heat president Pat Riley has experienced countless glorious moments in a Hall-of-Fame NBA career and may not be done in Miami as he tries for a 10th championship ring.

But the former Lakers and Knicks head coach counts his inability to guide Patrick Ewing to his only NBA championship as possibly his biggest failure. In MSG Network’s new special dealing with the 1994 playoffs in which the Knicks advanced to The Finals, Riley says on the program, in excerpts obtained by The Post:

“Patrick was a guy that gave everything he could give to that city to try to win a championship. It’s probably one of the biggest disappointments had in my life not being able to give them enough in Games 6 and 7 when we were in Houston, so Patrick could’ve gotten his first championship.”

The Knicks were beaten by the Rockets in 1994 in seven games after holding a 3-2 lead when the series returned to Houston. Wednesday’s special is the kick-off to the final 10 episodes of “The Garden’s Defining Moments” – which was broken into a 20-part series.

The MSG Network special Wednesday night deals with the 1994 Eastern Conference Finals vs. the hated Pacers, when the Knicks advanced to Houston after surviving a classic Game 7 at the Garden on Ewing’s last-second putback dunk off John Starks’ miss on a baseline drive. Ewing jumped onto the scorer’s table afterward, arms raised to the pinwheeled ceiling in one of his greatest moments in a Knick uniform.

“I remember Pat (Riley) was running a lot of different plays and I went over to him and said ‘Pat, forget all those other plays that you are running, I am the one who is going to get the blame if we lose and the praise if we win so the buck has to stop here, get me the ball and let me go do my job,’’ Ewing said, according to the show’s excerpts.

“The Pacers jumped up to try to stop John from coming over the top of the pick and roll. He drove baseline and I just rolled and followed him. Once the ball went up, everyone stood up with their mouth wide open. I was able to come back and just put it in and everyone just jumped.”

Ewing, a Charlotte Hornets associate coach, said of his 1985-2000 Knicks career: “I had so much joy playing in New York, playing in front of all of those fans. I enjoyed every minute of it.”

Jeff Van Gundy, Riley’s assistant coach during the 1994 Finals run, says on the special: “It’s almost hard to believe such a superstar could be so loyal and so dedicated. I’ll have to be honest, only fools underappreciated Patrick Ewing. Ewing stayed the course through some frustrating times, but his single-minded approach towards winning set about a whole culture shift in how the Knicks perceived themselves.”

Knicks second-year coach Derek Fisher has talked about getting the Knicks to play with the toughness of the 1990s Knicks and 7-3 rookie Kristaps Porzingis is setting single-game shot-blocking numbers exceeding Ewing’s from his first year.

Riley, who has won nine titles as a player, assistant, head coach and president, talked about the culture he established during his Knicks coaching reign from 1991 to 1995.

“Our sort of culture, mission statement was that we were going to be the hardest-working, best-conditioned, most professional, unselfish, toughest, nastiest, disliked team in the NBA,’’ Riley said on the show. “We didn’t care about it. That was our identity. That is who we were.”