We are sorry to hear about your experience with your Samsung Galaxy Z Flip 4 having issue of shutting down when you flip it closed. I feel and understand your situation, bit worried when your beloved phone is misbehaving. If it happens to my device, I will feel the same.
Before you try out the below recommendations as to your solution, be sure to check if your device's software is updated with the latest version. Please check how to update your mobile device's software in the following order.
Step 1. Go to Settings > Software update.
Step 2. Tap on Download and install.
Step 3. Follow the on-screen instructions.
If your phone is misbehaving, it's possible that a third-party app is causing the issue. To figure out what app is acting funny, you can use the Safe Mode feature. In Safe Mode, your phone won't run any third-party apps. This allows you to easily identity and remove the app that may be causing the problem.
Boot a Samsung device into Safe Mode:
Step 1. Turn the device off by holding the Power button until the option to Power Off appears on the screen. Tap Power off.
Step 2. Press and hold the Power and the Volume Down buttons at the same time, to turn the device on. When you see the Samsung logo appear on the screen, you can let go of the Power button while the device boots up. Make sure to keep holding the Volume Down button.
Step 3. If done correctly, 'Safe Mode' will display on the bottom left corner of the screen. If 'Safe Mode' does not appear, repeat the steps above.
Step 4. Once you're in Safe Mode, you can remove the third-party app that is causing issues on your phone.
Exit Safe Mode.
To exit Safe Mode, simply restart your phone and it will reboot normally. You can also enter Safe Mode by pressing the Power key, touching and holding the Power off icon, and then touching the Safe Mode icon.
If that doesn't fix the problem, you may submit an error report through the Samsung Members app as follows:
Step 1. Long press Samsung Members icon on Apps screen and tap Error reports.
Step 2. Tap OK on agreement popup to send system log data.
Step 3. Select Symptom category "Power/Battery/Charging".
Step 4. Describe the problem in details and SEND.
If the issue persists, you may bring your device to the nearest Samsung Authorized Service Center in your area. Rest assured that your device will undergo an assessment to pinpoint the root cause of the issue. They may guide you and offer solutions to restore it.
or book an appointment with the Samsung Members app as follows:
Support > Book an appointment to set one.
Should you need further assistance and guidance, you may contact us via our online Samsung Customer Care support channels below.