The issue with drugs under patent is that the alternatives are often not as good. If the FBI needs a vehicle, it doesn't really matter if it's a Ford or a Chevy, but sometimes a drug under patent is quite a lot better than the available generic and then the seller can command a much higher price than the competition. Which is whole point of the patent system. In exchange for funding the research/trials you get a temporary monopoly on the drug and get to charge the monopoly price until the patent expires.
They're now proposing a different system where instead of taking bids, the government dictates the price and can blacklist the entire drug company if they don't accept the government's price for every individual drug. That's price controls and the result is consistently under-production. For commodities that means shortages, for R&D it means fewer new drugs.
But that’s how the IRA works.
Also, the way Medicare Part D was set up, the government doesn’t buy the drugs in the first place. Private insurers negotiate their rates and then are reimbursed. They already have significant market incentive and power to negotiate lower prices.