I see what you're saying. Could a simple counterexample for the complex case be A=[[0,i],[0,0]] and B=[[0,0],[i,0]] (keeping x=[a,b])?
If the operator matrices are self-adjoint, it seems A would always equal B ... for instance, A=B=[[0,1],[1,0]] or A=B=[[0,i],[-i,0]]. Is this right? OK, so...