Will my H1B be valid if I move to H4 EAD when my Greencard processing is in process

I have a situation where I am going to max out on my H1B years and my company filed for perm which has not completed for an year. So I won’t get an extension of 1 year on my H1-B. My wife is having approved I140, will I be able to convert to H4 EAD and work for same employer until I get my perm approved? or will my H1B is going to be void, if I convert to h4 EAD and work for same employer? or Do I have to wait for my I140 to be approved and just stay in H4 status?

Yes as far as your employer if good with this arrangement.

After changing to H4 you will need to wait till your I-140 is approved to switch back to H1B.

Consult your employer’s immigration lawyer and discuss your situation so they can guide you further.