Ok first what confuses me is that you said you were confident in your read on opponent. Well either of them hands you were confident on had you beat PF.
Now you seemed priced in to make the min 3 bet call,but still probably felt behind PF,if you felt confident like you say on your read.
Now the mistake comes in your confidence if you want my honest opinion.
You flop middle pair and get excited lol,but there are so many hands left that can beat you,and even if you were correct about your read on opponent then they would still have to over A/Q cards to your middle pair,and you would still be at risk,
Personally I think I would have found a better spot to get my money in.
Mistake, NOT cooler. Extreme example of a cooler is when you hit a set on the flop and villain straights out, or flushes out. Any conceivable concept of 'Cooler' can NOT contain hero owning K8o.