pcos/ed/ gaining weight /help /tw

i have ed and i was my best shape when i literally tortured my body. later i’ve gained like 2 kg and was living with that but still not eating well. or night eating and throwing up. in march 54kg i decided to eat healthy 3 meals (still around 1000cal -1200) +almost everyday workout and everyday 1h or more walk and im going weight now its 56 how is it even possible? before i was eating at random times and i was eating lots of bread and my weight was lower how is it possible? how can i loose 6kg?