Correct option is D
This situation is covered under the General Exceptions of the Bharatiya Nyaya Sanhita (corresponding to Section 14 of BNS), which states that "Nothing is an offence which is done by a person who is bound by law to do it, or who by reason of a mistake of fact and not by reason of a mistake of law in good faith believes himself to be bound by law to do it."
Here, ‘A’ is a court officer acting under a lawful order and makes a genuine mistake of fact after due enquiry. Hence, he is protected by this exception.
Information Booster:
Mistake of fact is a valid defence under the law when done in good faith and under legal obligation.
Mistake of law, however, is not excusable.
The officer must show that the error was honest, reasonable, and based on due diligence.