I think your payroll made a mistake because they don't know the difference between a temporary foreigner worker and a person with PR.
If you stay more tahn 5 years, you are eligible to file tac return using 1040 otherwise you use 1040NR. For OPT, you are still on F1 status but with special purpose to train in your field. When you are on H1B, they consider you ahve the intention to apply for green card so you have to pay whatever the US citizen pays.
I think your payroll people do not really understand the documents. They thought if you stay more than 5 years, then you are an US PR. You can file tax return as a citizen, but it doesn't automatically grant your green card. Tell them the difference, and get your refund back.