H1B extension after 6 years and PERM is in process less than 365 days

My 6 years of H1 will be ending on 30th Sept, My PERM is in process ( less than 365 days). I received 2 months of recapture time so should be fine till Nov 30th but doesn’t look like my PERM will get approved by that time. So my questions are:

  1. Can I switch to H4 status before Nov 30th and once my PERM and i140 get approved switch back to H1 again without leaving country?
    ( i know COS will take long time but don’t want leave the country and family now)
  2. What if my employer laid me off ?
    Can I still switch to H4 and stay here in USA? If so how can I again switch back to h1, do I need to find new employer and start the whole GC process again?

Yes. If your spouse is on H1B you may do COS to H4. Once I-140 is approved, your employer can file cap-exempt H1B with premium processing along with COS from H4 to H1B.

Yes, you need to apply for COS from H1B to H4 before your H1B expires or with in the 60 days grace period if you get laid off.

Your employer may still keep processing your I140 after you are laid off and if they are willing to sponsor the green card job for you. Otherwise the new employer will need to restart the green card process.
If you dont have approved I140, you need to stay one year outside of the US and your new H1B employer need to file cap-subject H1B under the lottery and if selected you will need to go for H1B visa stamping and come back.

You still have an option to work on H4 by filing H4 EAD if your H1B spouse has approved I-140.

Thank you Kalpesh for answering all my questions.