You might be gaining because you're literally starving yourself, and your body is responding accordingly.
I'm around 172lbs, 19% ish
If you don't eat enough, your body starts to protect itself. I'm eating *more* and losing weight...
You probably did something similar to me: you put yourself into such massive calorie deficit that your body started protecting itself. I bet if you up it to 2400+ you might see all kinds of improvements.