There will be 32 halvings, but the block subsidy will be reduced 33 times with the last reduction not halving it, but reducing it from 1 sat per block to 0 sats per block (see table with calculation). So there will actually be 33 eras with a block subsidy, which would mean that per your calculation the last new bitcoins would be created in 2141.
However, the first halving occurred in 2012, so that's how you get to 2140 if you assume 4 years per era. Actually, the average time per block since the Genesis block has been about 9.5 minutes (4,431 days for 671,456 blocks). In 2020, the average block interval was about 9.9 minutes. Assuming that an interval of 9.9 minutes would be maintained, the last block with a block subsidy would be found in December 2138.