While I certainly don't support the 'rogue engineer' excuse that VW originally gave everyone, the idea does bring up an interesting point. An engineer did write this code. Almost certainly, many of them, working together. Now, their managers told them it was okay to do this, maybe that legal had given the go-ahead or that they had to do it to keep their jobs... But it's still pretty clear that this was not right. The…
And, IMO, yours is absolutely the correct one.
As engineers, we are in a unique position to understand the intricacies and associated risk to any one of our functional requirements we satisfy. True, we are under marching orders from a PM who may (or may not) have provided adequate backstory to understand the goals of the company, but it's our duty to express any concern of risk it may present to the company or society.
When verbal warnings don't work, go ahead and put it in writing.
In the US, part of my engineering curriculum included courses on engineering ethics case studies to drive this point home.
I've written exactly 2 of these letters in my 10yr professional career. On both, the PM sharply changed course, demonstrating their knowledge of failure of the ethical litmus. Putting written responsibility upon them to act encouraged further discussion and ultimately a better resolution for all.