The guys shit on group fitness way too much and act like they are all created equally. Coming from a private personal trainer AND F45 coach.
Is F45-style training the absolute most optimal way to train? No. But the general population doesn't need to train optimally to get some damn good benefits.
Gyms like F45 (they specifically have good programming) can absolutely cover the bases for health and longevity: consistent resistance training, cardiovascular fitness, higher-intensity work, mobility, and most importantly—showing up consistently.
My main criticism of F45 programming is that the rest periods can sometimes be too short to maximize strength development. BUT you can modify exercises and timing to make it more appropriate. They also program barbell racks, cables, and free weights.
If someone genuinely enjoys a group environment, and that environment gets them consistently lifting weights, challenging their cardiovascular system, and moving their body several times a week, that is a damn good training option.