H1B filing with change of status (H4 to F1) pending and current H4 status is expiring

Hello,

My wife is currently on H-4 visa and it is expiring on July 31, 2022. We have applied for her change of status (H4 to F1) on June 12, 2021 and it is still pending. she is getting her diploma at the end of august in 2022.

Her H1B got selected in the lottery for this cycle and I am planning to apply for her H1B considering the fact that we will get RFEs and will respond to it once we have diploma ready.
I have two questions:

  1. Since she will be out of status after July 31st, her pending change of status application will let her stay in the states. I am not very hopeful for approval of COS application so is it worth to keep that application and proceed with H1B application with associated risks?
  2. As a second option, I am planning to withdraw COS (H4 to F1) application and immediately apply for H-4 visa extension for next few months and proceed with H1B application.
    I need a help with which option is more safe and better for me in this situation?
    I would sincerely appreciate any guidance and help here.