To be clear. You fasted for 4 days? How is this a failure?
Your body said est after 4 days so you ate. Nothing wrong with that.
If you continue to think ‘fail’ and ‘punish’ you won’t be successful at the fasting lifestyle.
Consider, you are training your body to fast for longer and longer periods and then deal with that mental aspects of fasting.