Companies often have disputes with the government about the proper classification of something under a law. Just because the government agency states should an opinion doesn't make that a legally binding resolution of the dispute. Indeed, it's likely this settlement is happening because neither side wants to go to court and risk having the question decided against them.
That's not true at all. People hedge their risk all the time. Do you think that every single person who takes a plea bargain is guilty of the crime they're charged with?
That is a different situation. Mylan says they did nothing wrong, but are transferring $465M anyway. In return, the government will no longer consider the matter in a lawful court.