It turned out that trading queens, even though it momentarily put me into check, allowed me to set up a trap on my opponent allowing me to get up a piece for two pawns. Also two of my opponents three pieces that were left were boxed in by the pawns so it was as if I was up three pieces, which is why I was winning the game shortly after trading queens.
en.lichess.org/RD2wWYAZ/white#51
en.lichess.org/RD2wWYAZ/white#51