You are going to have to talk to a tax specialist like a CPA to know the exact answer but there is a big difference between tax withholding and your true tax burden. You will just get the money back when you file next year if you overpaid. 40% is really high so I think it is unlikely that there will be any penalties. Was that really all federal income tax or did it include state and other taxes?
Typically, severance pay is taxed at the same rate as your employee wages. The full answer is complicated but it largely depends on your state. In no case should there be a federal tax rate of literally 40% because no one in the U.S. has a federal tax rate that high. It has to be a mix of other taxes. That doesn’t mean that your former employer calculated the tax deduction correctly but it also doesn’t mean that you can’t get some of it back if they made a mistake.