> if I485 denied for some reason then can i file gc on my behalf
It depends on what grounds it was denied. If it was denied bc there was some problem with your wifes GC petition, it wouldn't prejudice against you filing for yourself in the future. If however, they deny your I485 because you have some grounds for inadmissability (fail criminal background check, unlawful presence, unauthorized employment etc) it is unlikely that a GC petition filed for yourself has better chances to be approved.
The problem is that once you use your EAD, you are not in H status anymore. So if your I485 got denied without warning (e.g. by your wifes I140 being withdrawn by her employer), you would be out of status causing trouble to get a GC later on.
So, if you have a residency on H1b, don't use the EAD to moonlight. Stay on the H1b until the GC based on your wifes case comes through. You might have to wait a year or two until you can start a fellowship (they rarely support H1b), but it is probably worth the wait.