i suggest using this app for many reasons but one of which they have a trend weight which filters out noise. an example would be in the past my scale weight was 215 but my trend or actual weight was about 225.
my trend weight is now 207 but I recently overate and my scale weight showed 215. I was able stay calm and not think I gained back weight as my trend weight only went up to 207.3
https://macrofactorapp.com/macrofactor/
also, ketosis is a natural diuretic . so if you ate a bunch of carbs and salt what you described can happen .
You should eat to keep your insulin levels down - keto, Mediterranean while OMAD or IF. Eating sugar and carbs will spike insulin which increases water retention. The first week of the fast is primarily water loss due to the decrease in insulin levels.