Many times, people who exercise will lose weight at first, and after a period of fitness, they will eventually gain weight again. These are all related to your muscle gain. If you just want to lose weight, you will need a lot of aerobic exercise. If you only do anaerobic exercise, your whole volume and weight will increase.
Also, you don't have a strict diet when you exercise. You add too much self-relaxation to your diet, and you will eat more after you exercise again, which will eventually lead to your weight gain.