The Anderson Tapes
(1971)

Duke Anderson (Sean Connery) is planning to rob every apartment in a house. All goes well, until one of the tenants, a handicapped boy in a separate room, is able to call for help through ham radio. The police are able to stop the heist and everyone is either caught or killed, with the exception of Anderson. He is wounded, but is able to hide in his girlfriend's (Dyan Cannon) apartment 2b. While searching the basement of the building, the police finds the tape recorder that records all from the apartment 2b, and hears the sound of Anderson, so they are able to arrest him. Since all the tapes made by different law enforcement agencies at different times (for unrelated purposes) are illegal, they are deleted.

Everyone who was contacted by Anderson was under illegal surveillance by a different law enforcement agency for a different reason. Even though the plot to rob the townhouse was overheard by them all, none of them took action because burglary wasn't within their fields of operation. Instead, the heist was foiled by a sharp-eyed kid and when the arrests were made the various agencies had to erase the tapes of their subjects, who were now under arrest for burglary. They did not want to be caught with illegal wiretap tapes in the ensuing investigation.

Thanks Tilman!