Weight alone would not be a reason to fail a Class one medical.
At your age, your Doctor may well advise you to reduce your weight for your life-style.
At an older age, your Doctor may well advise you to reduce your weight for your life!
Weight-related problems could cause you to fail a Class one medical and it is easier to lose it at a younger age and maintain that weight loss, than it is at a more 'advanced' age.
Ask your GP to refer you to a nutritionist rather than follow one of the many commercial programmes, which boast of their few successes but fail to mention their many failures. Beware the "secret calories" (mainly alcoholic)!