When working in contemporary corporate cultures the most important rule is CYA.
CYA = cover your ass
If your manager asks you to do B instead of A - which you think is the correct solution, you write them an email. You write that in your opinion A is correct and that you understand he wants you to do B instead. You ask him to correct you if you are wrong.
If afterwards you are ever told you did it wrong and should have gone for A you forward the person the email thus proving it wasn't your idea to go for B.