You could conceivably get to 4w/kg at 100kg but it will be a whole lot faster and easier to get there by working on both parts of that fraction. It’s pretty difficult to conceive of anyone being at an optimal weight when their BMI is 31 - in the obese category. (and FWIW, I’m not talking down at all - I’m right there with too with a 31 BMI at the moment.) You and I could both stand to lose 15+ kg.
I would attribute your trouble on a group ride to one or more of the following: not hydrated, not rested, not enough nutrition, cutting calories too fast (which can really tank energy levels for me), or maybe the ride was a little faster than recovery pace?
My $0.02 is to keep at it the training and make good choices about what you eat. The weight will come off and your performance will increase (probably pretty quickly.) I think you’ll find a nice spot around 75 to 80 kg and 300 to 320 watts that will put you over 4 w/kg and I’d plan on it taking about a year to get there.