This study is popping up in a lot of press right now. But what it actually says isn't that weight loss is not important. Rather, it says that the typical result of trying to lose weight with dieting is weight cycling, which is more harmful than not losing that weight in the first place. So better to focus on exercise, which has less downsides.
It's also unclear to me if they're able to fully account for the fact that people unable to exercise are probably less healthy.
https://www.cell.com/iscience/fulltext/S2589-0042(21)00963-9