If you have worked as an electronics engineer with both clients and bosses, which one do you consider worse: an unhappy boss because you didn't do your job (right) or a dissatisfied client who paid good money for a faulty product ?
It all depends upon why each are unhappy.
If the client is unhappy because the product is faulty, it could be that :-
(1) You stuffed up.
(2)Something unanticipated happened, like a faulty component, or someone dropped the thing.
(3)You did exactly what was requested of you, & the customer's specification was incorrect.
(4) You did exactly what was requested of you, & the Boss intervened, changing how you did it.
For (1) you "fall on your sword", or at least take responsibility.
For (2), hope that those responsible will own up.
For (3) point this out to the Boss, & hope he/she will diplomatically tell the client so.
For (4)Start looking for a new job not managed by morons.
If the Boss is unhappy for:-
(1) --same advice as in the "client " case.
(2)same advice as before.
(3)same advice as before.
(4) And blames you?--------run , don't look back!