A veteran NYPD officer who was nearly stabbed to death by a man in 2008 — only to watch the ex-con go free after allegedly attacking another officer Sunday — says he’s outraged by the revolving door of justice.

“It’s insane,” Queens Officer Demitrios Raptis said Tuesday to The Post, which exclusively revealed the mind-boggling bail-fail case involving his attacker.

“I could have died that night,” said the 42-year-old officer, who was brutally attacked by accused repeat cop-assaulter Isus Thompson more than a decade ago.

“I mean, six times to the abdomen,” Raptis said of being knifed by Thompson.

“The vest took a lot of it, the shirt and the vest,” he said of his protective police gear amid the brutal assault. “[The knife] hit my skin, too. If the vest didn’t take the impact of [the attack], it could have killed me.

“I think the guy should be locked up, shouldn’t be let out,” he added of Thompson, 38. “He could have killed this officer [Sunday], too. He should be behind bars. I don’t even know how he got out.”