We've been sold a lot of lies in our diet culture and it has messed up our bodies in ways we are only just establishing. There are answers though and you are far from alone, these drugs have given some powerful clues about the answers.
While it is true that eight is about calories in vs calories out but our bodies have clever ways to limit calories out, including making us tired and less fidgety so we don't move about as much (so reducing our non-exercise activity thermogenesis (NEAT)) and reducing the energy it puts into our immune system, which is quite scary to think about.
Before it does that it burns not only fat but also muscle, especially as muscle is 'expensive' to keep as it needs more energy just to maintain.
500kcal a day (or close to it even if you are not recording accurately) is probably doing both of those things.
Fuel yourself with the things your body needs, at least 30g of protein per meal (more at breakfast if you can) and 30g of fibre per day, much of it from natural sources (build up to it slowly if you are currently having much less).
Tell your body it needs the muscle, do some resistance work either 15 minutes per day or 45 minutes 2-3 times a week. There are various free programmes online but if you want help finding them then ask, there are people here who will happily help you and cheer you on. 💐
If you can afford it then buy some bioimpedance scales that don't just tell you a weight, they also give a rough idea of what that weight is made of - they aren't perfect but they will show trends over time. The greatest measure will be increases in strength as you find you can lift heavier and heavier things more often but the output of the scales week by week can help too.