The professor didn’t say that you would get a B if you passed the final and did the extra credit.
He said that if you passed the final and turned in extra credit, you could raise your grade to a B. Translation: it is possible for you to raise your grade to a B, but you would’ve had to have done well on the final and turn in the extra credit (and potentially do well on that, too).
In general, professors have no desire to ruin your GPA or any particular investment in the grade that you get for a class. In fact, most professors want to see most of their students do well. You get the grade that you earn.