Hello sus7340,
It looks like you joined us from an excellent resource (and the correct steps for signing out of iCloud); Sign out of iCloud on your iPhone, iPad, iPod touch, Apple TV, or Mac - Apple Support. Check out the following information from that page:
When you sign out, any data stored in iCloud will be removed from your device but will remain in iCloud. Before you sign out, you’ll be asked if you want to keep a copy of any of this information on your device.
You may have a delay, as information is uploading and saving to iCloud while also removing from your device. If that is the case, you'll want to make sure your iPhone is connected to a strong and reliable Wi-Fi signal, to complete the process more quickly.
If the issue remains or the device becomes unresponsive, you can follow these steps to help resolve the issue: If your iPhone won't turn on or is frozen - Apple Support.
We hope this information helps you out.
Cheers!