I don't know where the line is or how it should be done, but I know as much as I know anything that it's not the proper solution if it ends with "and some innocent bystander live was (temporarily) ruined in the process".
(I used that exemple because it's the one I always remember as the court case marked my mind, but I'm sure most countries have an equivalent)
"At least 20 of the undercover officers deceived women into intimate, sexual relationships.
The women had no idea that they were having relationships with men who were police spies. Some of the undercover officers had relationships with more than one woman during their undercover missions.
After the existence of the covert operation began to be exposed in 2010, the women grouped together and successfully took legal action against the police. So far, the police have paid compensation to at least 12 women who were deceived by the undercover officers."
"
https://www.bbc.co.uk/news/magazine-29743857
Trying to remember the name of the book it is covered in, too
Edit: Book was "Undercover: The True Story of Britain's Secret Police" iirc
[0] https://www.imdb.com/title/tt1465487/?ref_=nm_flmg_act_20
The film has been remade in several countries, so I guess there is a market for your idea.
In 2010, Takeshi Kuwabara was sentenced for the murder of his lover, Rie Isohata. What captured the world’s imagination was not the tragedy itself, but the fact that Kuwabara was a wakaresaseya – a professional hired by Isohata’s husband to break up their marriage.
Once Isohata learned of the deception, she angrily attempted to break off the relationship with Kuwabara. Unwilling to let her go, he strangled her with a piece of string. The following year, he was sentenced to 15 years in prison.
There is definitely a dark rom-com movie script to be made from this story.
Edit: I just remembered, there is an old Italian film which has a similar plot. It's called Divorce, Italian Style and is about a man who wants to divorce his wife, but can't due to the local laws. He spends the movie trying to get his wife to take a lover, so that he can shoot her "in a rage of jealousy" and get a reduced sentence for manslaughter. It's pretty funny, I highly recommend it.
https://en.wikipedia.org/wiki/Divorce_Italian_Style