You need to be careful not to lose weight too quickly, since that has risks of its own. It is a risk with extreme diets such as extended fasting.
Excessively fast weight loss can cause liver injury. Most obese people will already have some degree of fatty liver disease (NAFLD), and while gradual weight loss is beneficial in reversing that liver disease, excessively fast weight loss can have the opposite effect and promote liver disease progression.