There are several reasons why TeamViewer may be blocked by a firewall:
Windows 10/11, corporate firewall (SonicWall/Cisco/Fortinet), TeamViewer v15+ teamviewer blocked by firewall
TeamViewer blocked by firewall – outbound connections failing There are several reasons why TeamViewer may be