so Qinheng-jun, Lan Wangji and Lan Xichen were all faced with basically the same choice right. Person you love has killed/attempted to kill Lan sect members, according to the rules of justice they deserve to die for this. what do you do.
Qinheng-jun takes the shitty middle road. Protects this person from death but doesn't let them go free.
His brother raises his sons. We can assume they are constantly told, don't be like your father. If you are ever in this situation, take the righteous path.
It happens to Lan Wangji. He doesn't take the righteous path. He goes far further than his father. Prevents the murderer from being captured, injures his relatives himself to defend them. He is horribly punished for it, it's the worst thing that has ever happened to Lan Xichen and Lan Qiren, and it doesn't even work, Wangji's beloved still dies. Clear object lesson for Lan Xichen. This is the only, the greatest mistake Wangji has ever made. Lan Xichen can never, will never, make it himself.
Of course he would be thinking about it, after Wangxian bring their suspicions to him. Of course that's what's behind his conversation with Wei Wuxian about Lan Wangji and their parents. Of course he has to be trying to psych himself up about it, from the return of the Cloud Recesses pass to the final confrontation in the temple.
Even Wangji is reminding him that he knows what he has to do. And yet he doesn't want to, he doesn't want to, he'll take any other option, please-
and yes, he's tricked into it, but how much can he hide behind that when in his heart he'd already made his choice? He passes the test that his father and brother failed. Despite his little indulgences and loopholes, he is a good Lan. He can't be anything else.