Does reinitializer work during contract deployment?

I have deployed an upgradable ERC20 token first and verified it.

  1. Token contract implementation: https://amoy.polygonscan.com/address/0x172B508a2961CCb0F45F501E13410517a550676c
  2. Proxy: https://amoy.polygonscan.com/address/0x54D7E85668fdB05A2501edb1565fBbf5e2e8Bc07#code

Then I upgraded the contract with new logic contract (added mintable). That is here:

I have a new initialize function with reinitializer modifier in the version 2 that I was expecting it work during the deployment but it didn't and I had to call it manually. Is this the expected behavior or did I do something wrong? My initialize function in the version 2 is this:

function initializeV2()
        external
        reinitializer(2)
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _grantRole(MINTER_ROLE, msg.sender);
    }

If you are calling the ProxyAdmin contract directly to perform the upgrade, set the encoded function call for your initializeV2 function in the data parameter. See https://docs.openzeppelin.com/contracts/5.x/api/proxy#ProxyAdmin-upgradeAndCall-contract-ITransparentUpgradeableProxy-address-bytes-

If you are using Upgrades Plugins to perform the upgrade, use the call option for Hardhat or the data parameter for Foundry.