OP, I won't say a bald 'it's not HRT' but the reality is, it's very unlikely to be. There is no evidence to say that HRT contributes to or addresses, weight gain. In theory, it will not affect weight gain, but neither will you lose weight - however, it helps with bloating, as well as sleep and energy levels so it makes it easier to exercise and eat healthily.
Clearly in your case, there are a combination of issues going on, it simply cannot just be HRT - you haven't even been on it recently!
I don't have a weight issue so I am reluctant to say too much BUT I did notice a small increase in weight as I hit 40, largely offset by a better physique and overall shape (as I increased by strength and resistance training, from mostly cardio, especially running).
But more generally, in the last few years, prior to, and since, taking HRT, I've had to deal with issues of not having an appetite in the same way, bloating, feeling unwell or unhappy with my shape, and just not being ... 'right'. So I do get the overall point.
I think most posters make useful points but it's how to decide which are relevant for you! In your 40s, and in peri, you need to completely reassess your approach - like @JinglingSpringbells having been firm on the need for carbs in my diet my whole life, I have had to recalculate, I can't eat a full sandwich for lunch now - so I could have maybe a half sandwich and then some fruit / yogurt and feel fine. I also struggle to eat after 7 or so in the evening but I often have to, due to my schedule. In recent weeks I've switched trainer and am doing shorter, more intense sessions (35 minutes no rest, from 45) and heavier weights, in the weights sessions. I feel hugely better but that is possibly also psychological, rather than necessarily physical. People kept telling me I looked great but I just felt not myself and haggard.
I don't think there is a shortcut - it's about experimenting with different exercise and eating patterns, no one person's approach will suit everyone.
If you are on IG there are great accounts of women 45+ who were fit and looked well beforehand but found themselves exhausted and drained by exercise and really overhauled their approach, including duration, type and intensity of exercise and increasing protein, it's amazing to see the difference and I've taken suggestions on board.
For me HRT was the starting point - I couldn't survive without it.