If a private investigator gets caught spying on someone and the person calls the cops on the private investigator that private investigator can legally in some places be charged with stalking and be arrested.
Likely though they will just get a warning from the police and then told to no longer make contact with you.
Some professional private investigators will let the police what they're doing and so in those cases they usually won't get into trouble for spying on someone.
But if a person wants to press charges against a private investigator then they legally can.