Some employers, like my employer, like to start you on TN, then switch to H1B, then sponsor GC EB2 or EB3 for permanent residence.
You can go TN status directly to GC, but you have an approx 9 months that you cannot travel in/out of the US, and should have 9 to 12 months before TN expiry before filing Adjustment of Status (AOS). Your employer will get you on H1B so you can travel (H1B has dual intent status, TN does not). TN is easier to obtain, can be obtained at any time, and has no cap.
Each petition, the TN petition and the H1B petition, have different criteria to qualify. You need to ensure the role and the person qualifies for both TN and H1B. In my case, I am a Canadian, with four year engineering degree from a Canadian University, performing an engineering role. Easy to qualify for both TN and H1B, or so my company law firm thought. I was on TN less than a year and the law firm applied for H1b for myself. I did not get picked in the lottery. After dragging their feet for several more months, they started the GC sponsorship and said they will try the H1B lottery again the following year. In June, confirmed I was picked in the lottery, then Aug they received an RFE (Request for Further Evidence). Responded to RFE, then in November received notice from USCIS that my H1B was denied. My employer lawfirm was very surprised, something about "speciality occupation", this was during the Trump era much higher H1B denial rates. My employer lawfirm filed MTR (Motion to Reconsider) within 30 days, and after several more nervous months, my H1B petition was ultimately approved.
So to answer your question, yes, you can have H1B denial, and still have valid TN status, as I have personally experienced. Each petition is separate, and based on separate criteria.
My H1B approval was an I-797b approval notice without an I-94 card. As Nelsona mentioned, typically you have an I-94 attached, and once you are approved your status is changed from TN to H1b automatically. I believe my employer did not request I-94 with approval, as they would have also had to request change of status for my spouse and child from TD to H4 at the same time, and involved more fees. (they already paid more than expected for RFE and MTR, all H1B related fees must be paid by your employer, by law).
Once I obtained the original I-797b approval notice from the lawfirm, my family and I drove to San Diego, PED West CPB office at San Ysidro POE, (POE with Tijuana Mexico). I had the option to fly to Canada, at my own expense, and on my return request status change from TN to H1B. I chose to drive to San Ysidro, since I live in Southern California, and it is about two hour drive. We shown our Canadian passports, original I-797b H1B approval notice, after paying $6 each for I-94 card, photographs, fingerprinting, we obtained new I-94 cards with H1b/H4 status with new expiry. CBP kept the TN/TD I-94 cards. We confirmed our status change on the I-94 website.