Mr. Pérez was an actor, a detective and an insurgent. To the government he was a terrorist. To his followers he was a freedom fighter, a modern folk hero in the ilk of Robin Hood or Che Guevara. Some skeptics said his story was too improbable to be true — they mused that he must have been a double agent of some sort, meant to cast the opposition in a bad light.

However people viewed him, his actions resonated across the whole country.

Venezuela has suffered from an economic crisis that has left hospitals without medicine and babies dying of malnutrition. An unpopular president has put down protests with an iron fist, leaving more than 100 dead on the streets of Caracas last year among police and protesters. Few seem to hold out hope for democracy in Venezuela.

After his helicopter flight above Caracas in June, Mr. Pérez became an avatar of the nation’s mounting grievances: He was the daring cop who had defected and asked others to do the same.

But if there is one thing that would haunt him to the grave, it was that the rebellion never came.

“We wanted there to be a call to the streets that day, there to be big displays, that the people realized there a movement had started,” he said in one of his messages. “But unfortunately, there wasn’t one.”

Mr. Pérez, who joined the investigative unit of the Venezuelan police 15 years ago, might have been just another detective if it hadn’t been for his acting. The film he starred in, “Suspended Death,” or “Muerte Suspendida” in Spanish, was released in 2015. He plays an inspector named Efraín Robles who rescues a Venezuelan businessman from kidnappers.

He said the idea to act in the film had come to him after a police operation in a poor neighborhood in Caracas, where he met a young man on the verge of joining a gang. Mr. Pérez saw no way of talking him out of crime, but noticed how influenced the young man was by what he saw on television.