I did the opposite.
I was offered a job with provincial health care at age 38, in BC. The same week, I was offered a job with a private firm, so I compared the two head to head.
Two items made me decide on the private firm 1) the slightly better commute (it was only an hour back then, now it is well over), and 2) the cost for benefits with public company.
Yes, the public company would pay famously, but only upon normal retirement age.. eg combination of service and age =80 years... If i decided to quit at age 50 there would be a hit, even if I did not take the pension until age 65 (when the combined would still only be 77 years, not 80).
Also, the take home pay was quite a bit smaller. I was required to give something like 10% of my salary to the benefit plan, which was heavily matched... So much so, that the retirement pension for fully aged pensions was sometimes more than the takehome in the year before retirement.
However, in my case, we had already saved up quite a bit by age 38, so the normal growth of that demanded far, far , less money to be invested each year, else we end up paying more in taxes after retirement. not a good solution.
And with kids in grade 3 and 6, and a single income family, i wanted to retain as much money as I could for our family needs. We needed more money today for mortgage, kids summer camps, insurance and RESPs than we needed retirement funds when they are in their 30's.
So, I declined the public pension and benefit in favour of a private company, where I can better control my retirement allocations and funds for FIRE.