This law is about lying during interrogation. When a police officer is wearing the uniform, asking questions, acting in their capacity as a protector of the public, I think directly lying to your face should be a crime. Their authority as an officer is the very thing they are using to get you to believe their lie. That is a critical piece.
A detective doing undercover work may require a degree of duplicity to achieve their aim, their authority as an officer is not what gets you to believe their lie, they almost always conceal that fact from you.
I think these are clearly distinct arenas of law enforcement.
Do you think that a person wearing a police uniform (that every person has an obligation to obey so long as they make a lawful order), can also, in the performance on that same duty, lie directly to a member of the public?
As the law stands, they are allowed to lie as much as they want when in uniform, in public, and anything you say or do in response can be held against you in court. The proposed Virginia law forbids that in the case of children who are interrogated.
A detective doing undercover work may require a degree of duplicity to achieve their aim, their authority as an officer is not what gets you to believe their lie, they almost always conceal that fact from you.
I think these are clearly distinct arenas of law enforcement.