It doesn't always work, because sting operations often involve paid informants who are not police, but assist by luring offenders to a location that's under surveillance.
In such a situation, you might ask a similar question, receive an honest answer, and still get busted, because you participated in a transaction that was recorded by observers.
Plain clothes officers operating undercover aren't always placed in direct contact with targets at the moment of a bust. Sometimes they just need to gather enough information needed to orchestrate a bust, and then they just disappear, as if completely unconnected.
In such a situation, you might ask a similar question, receive an honest answer, and still get busted, because you participated in a transaction that was recorded by observers.
Plain clothes officers operating undercover aren't always placed in direct contact with targets at the moment of a bust. Sometimes they just need to gather enough information needed to orchestrate a bust, and then they just disappear, as if completely unconnected.
It's not like this is 1971.