Rhom I know you 3bet a lot from the blinds yourself with a good polarised range but this doesn't mean everyone does.
I noticed in some of your recent stats that you also don't like folding to 3 bets, maybe because you know how wide people can be. But you are projecting the way you think about the game onto others and it often isn't the case. Most 3bets are still for value.
Even against a polarised range and b v b you are going to be an equity dog nearly all the time here and oop.
Flatting this 3bet with this hand is a terrible leak. It is a clear 4bet or fold spot. Incidentally I have greater success 4betting from the SB over the BB than from any other position it nearly always gets through because the BB 3bets so wide here so don't be afraid to 4bet this spot.
The resulting hand is a classic example of how things play out with middle cards. You flop 2nd pair and never know where you stand with no initiative.
On the river I agree with betting, we are looking to get value from all his Qx. I agree that lots of weak Queens will check the turn looking for a cheaper showdown and to snap off your bluffs. It does seem like you've run into a flush but it's a prime bluffing
card for a guy with a high AF and a checked through turn indicating you aren't very strong.
I would probably have called a guy with AF 8 and expect to be good more often than not.