Malicious compliance (also known as malicious obedience) is the behavior of strictly following the orders of a superior despite knowing that compliance with the orders will have an unintended or negative result. It usually implies following an order in such a way that ignores or otherwise undermines the order's intent but follows it to the letter.
Malicious compliance example
PE teacher: You will do laps until your feet are bleading
PE teacher: Why didn't you stop when your shoes tore apart? your feet are bleeding