Due to losing the commit hash after making a squash merge, gommitizen won't be able to make a bump if you don't fix the commit hand to a new one that exists in the log.
One way to allow gommitizen to be resilient with this would be to send a warning to the user and show that you are not running in the master/main branch and ask for continuing o not the bump process.