Read this support article —> How to delete your Apple ID account - Apple Support
Carefully and thoroughly read that article for information about what happens when you delete your Apple ID account. For example:
"Make sure that you sign out of all your devices to avoid issues with apps that use your Apple ID account or iCloud. After your account is deleted, you can't sign out of iCloud or turn off Find My iPhone Activation Lock on your devices. If you forget to sign out, you might not be able to use your device when your account is deleted."
Potential solutions to your issue are to get the old account working again so you can sign out of it properly, or ask Apple to reset your phone.
From: How to delete your Apple ID account - Apple Support
"What happens if I change my mind after I have requested that my account be deleted?
While your request is being processed, you can contact Apple Support [using this link --> Contact Apple for support and service - Apple Support ] with the unique alphanumeric access code you received, and we’ll help you cancel your request. After your account is deleted, Apple can't cancel the request, reopen your account, or restore your data."
Apple can reset a device if a person can provide sufficient evidence of valid ownership (usually the original receipt from Apple or an authorized retailer —> *Apple recommends you "Keep your receipt after you buy an Apple device" --> Keep your receipt after you buy an Apple device - Apple Support ). Try this online here --> https://al-support.apple.com/#/additional-support (Yes, apparently this does work in this situation too: How to remove previously deleted apple id… - Apple Community )