Apple - iCloud sign out not possible on High Sierra
I was able to fix the issues by deleting the files in ~/Library/Accounts/
and ~/Library/Preferences/MobileMeAccounts.plist
then logging out and in again before opening the panels again. Warning: This also removes every other account you have listed in the accounts folder.
you need to sign out from the primary account. If you can login to icloud.com and check for device registered, if it is registered under same apple ID. Then go to settings>check for that device> click on "x" mark for removing device. Then reboot the device once and apple ID should able to signout from macos. Second option, go to system preference under users and groups. Select the local administrator and right click for selecting advanced options, check for Apple ID configured, in case of different apple. Try to change to your current apple ID and sign out from system preference.