JMG porsche has a procedure detailed on their site about "resyncing" a key fob and the immobilizer. It doesn't work 100% of the time but (it depends on how out of sync the two are) but it is worth a shot. For some reason the website isn't pulling up for me but I'm pretty sure this is the correct link:
https://www.jmgporsche.co.uk/index.php/menu-articles/articles-maintenance/item/234-996-986-alarm-primer