If you end your water fasts at 48h circa, you're missing out on most of the benefits as the body fully enters fasting mode past 36h-48h. So in a sense you're ending the fast when it is just getting started.
Can't give you medical advice, just a benchmark tip: a short water fast is 3-5 days, the first 2 days being the most difficult ones.
My personal experience is that mind/spirit plays a major role. If i'm down mentally, i'll break my fast prematurely. If you think about it, the only difference between fasting and starving are your motives and mindset. So this is a major item, that people approching fasting from a purely medical angle often fail to appreciate.
Make sure you are at peace, and embracing a mindset of healing, spiritual renewal. Have something to do. For example, as a Christian, this is a time where I'll read the Bible, sing/workship more frequently throughout the day, and of course rest. You can do something equivalent independently from your religion.
I don't know if this mental angle can help with your headaches, but consider giving it some though in case this can help. That's all i can think of i'm afraid. Just my 2 cents.
Headache goes away after few days when body switches to full ketosis.
I did several one month water water fast, the brain sharpen after a week usually. And I stars getting headaches agents below 10% body fat.
To be honest, for me the result is quite unbelievable. I never thought I'll lose 14kg in my mid 40's but managed to do it with very little exercise and following water fasting and mostly focused on diet, its surprising.
Looking back, when I was not remote working, I did intermittent fasting by default (not eating between 8pm to 11:30am), that kept my health in control. But WFH changed everything and gained weight.