After pawn d6 from black, Queen b3, forming the battery is slightly better than castling according to Stockfish. Because the opponent has to play the very sharp Qd7 or risk a lot of sharp attacking ideas from White.
good to win any old way, but in this case I wanted to see your opponent pull it off. He found excellent counterplay which he just needed to prosecute without overthinking it. it's always a shame to lose like that.