I've never had a weight problem so I can't speak from experience. However, most people do not want to spend all their spare time in a gym or even go to a gym every day. Thus, the problem is how to use gym time as effectively as possible. That requires making some compromises.
When practical, depending on the weather, I ride my bicycle to the gym; it's 5.3 miles and I consider that to be part of my workout. During the ride, I do at times push myself hard. If I don't ride my bicycle to the gym, I use a stationary bicycle at the gym for warmup and to provide some of my exercise. I start out at a gentle rate but after about four minutes, I'm working close to my maximum sustainable ability. After eight minutes, I step up the pace so that I am working somewhat beyond a sustainable limit. After 9.5 minutes, I'm working about as hard as possible which is well beyond a sustainable limit and pushes me well into oxygen debt. At 10 minutes, at which time I am breathing as hard as possible, I slow down to a gentle rate to recover and maintain that pace for a few minutes until I have completely recovered. Then, I begin my workout with weights. It may be unwise to begin a workout with weights without first having an adequate warm-up.
On a stationary bicycle at the gym, I can push myself harder than I can while riding a bicycle in traffic because it would be dangerous to push oneself to the absolute limit while riding in traffic.
Generally I go to the gym three times per week, but never on consecutive days.
Obviously there are multiple opinions. I suggest trying different things to see what works for you. I see nothing wrong with doing aerobic exercise before working out with weights as long as you don't become so tired from the aerobic exercise that it interferes with your weight lifting. That of course would rule out running for 10 miles at a stiff pace or riding a bicycle for 25 miles at a stiff pace before working out with weights.
It's interesting that what is now called cardio used to be called aerobic. I don't understand why terminology keeps changing; it doesn't seem to make any sense. Actually, aerobic makes more sense because it exercises more than the heart; it also exercises the muscles that operate the lungs and that is also important.