Azure subscription cancellation will not affect directory synchronization via Entra Connect - assuming of course that your Entra Connect components are NOT running on Azure VMs hosted by that subscription.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin