The issue is that the timezone data used by PHP and Carbon is not always up-to-date with the latest timezone changes. In this case, the timezone data being used by PHP and Carbon is outdated and does not reflect the correct timezone offsets for Mexico City and Cancun.
To fix this issue, you can update the timezone data used by PHP and Carbon by installing the latest version of the timezone database. You can do this by running the following command in your terminal:
sudo pecl install timezonedb
Once the installation is complete, you will need to update your PHP configuration to use the new timezone data. You can do this by adding the following line to your php.ini file:
date.timezone = "America/Mexico_City"
Replace "America/Mexico_City" with the appropriate timezone for your location.
After updating your PHP configuration, you should be able to use Carbon to correctly calculate the timezone offsets for Mexico City and Cancun.