UPDATE: resolved. I did in fact mess up the N=3. For some reason I thought that queries AAB would be enough but you do need at least four like in the editorial (BAAB).
https://mirror.codeforces.com/contest/1746/submission/176813280
because it's interactive there's absolutely no feedback on what's wrong in practice mode. I'm pretty sure I exhaustively checked all N=3 cases.