The weight you lost would have been mostly water weight, which was lost through the depletion of your glycogen reserves, as soon as you eat carbs again you will build up your glycogen reserves which are bound with water.
Is the answer not obvious?
Don’t eat fried pastries. That stuff has ridiculous amounts of sugar and way more carbs than chicken and broccoli. If you actually want to lose the weight and keep it off long term, you got to give up the junk foods.
You retain more water with carbs than with the other macronutrients. So the scale might say you gained weight, but it’s mostly water.
Coming off that dry fast is tough because your not eating or drinking anything. So that weight is easier to gain back because you wasn’t eating drinking anything. So for me personally, when I come off that fast I try to eat as little as possible to control my eating habits.
Take two days and eat very strict keto at maintenance calories. See how much the scale goes down. This is how much water weight you can expect your body to put on/take off simply by cycling in and out of ketosis. Subtract this number from any future losses to have a more realistic view of what’s going on.
So, there is something called ‘waterweight.’ This is weight associated with water stored in the body. When you eat lots of sugary/carb-rich foods, water is needed to process them, so the body holds onto water to use for this purpose, seemingly. The only way to not gain back waterweight is to go low-carb/keto/carnivore and stay that way.
It seems that the stored waterweight may be proportional to how high carb your diet is, so if you just ate lower carb perpetually, you would have less waterweight.
You may have stored a bit of body fat with the fried pastries, also, because raising your insulin levels by eating high glycemic loads or foods higher on the glycemic index (carb-rich/sugary foods) is what triggers your body to store fat. Our bodies have this mechanism, so we could stock up on body fat by eating a bunch of fruit off a tree and then we could afford to skip meals in the winter as we burned our body fat to survive.
You can still lose a lot of body fat fasting over time, but waterweight will come back depending on your general way-of-eating.
Also, you don’t necessarily need dryfasting to lose body fat. Water fasting works well for that. Though I always recommend only drinking water when actually thirsty, regardless. Dryfasting is kinda a more serious version of fasting that people turn to for trying to treat serious conditions.