First I would say don’t stress about a few pounds of weight gain. Your goal should be to be healthy and feel good; weight loss will come as you fix other issues, some of which take time to figure out. For instance you may be mildly hypothyroid and that will cause some weight gain. (You might ask your doctor for thyroid tests.)
I would focus on highly nourishing foods (eg liver, bone broth, seafood, etc) and on circadian rhythm strategies. Don’t make your exercise too intense – intense exercise only 1 or at most 2 days per week, the rest just circadian rhythm promoting activity. Maybe you should stop counting calories or following a program (other than intermittent fasting with 2 meals per day) and focus on listening to your body, eating to appetite, stopping when 80% full.