So, in this situation, your H1b COS will be deemed valid. Just be careful of the USCIS final rule I mentioned above.
However, extension of TN within US costs much more money and time (a few months), thus not practical. Usually applicants would just drive to the border to get a new one.
Then it falls in a situation where PJIANG's suggestion is crucial and helpful for you.