Purchased used or second-hand? If so, I’d guess that somebody hacked around Activation Lock somehow, and the hack just stopped working. If that’s the case, this iPhone won’t be useful.
If you purchssed this iPhone new, you’ll need the original purchase receipt or similar proof of ownership, and a discussion directly with Apple.
In general…
Activation Lock is intended as a theft-deterrent mechanism. A theft deterrent that is easy to bypass would not be much of a deterrent.
Nobody here in the Apple Discussion Forums can help you clear Activation Lock.
To clear an Activation Lock, you will need the password of the associated Apple ID, or the original purchase receipt and a discussion with Apple Support, or similar proof of ownership.
If this device was recently purchased and the seller is still available, contact the seller for remediation or for refund. A remote unlock using iCloud is available to the person with the Apple ID holding the Activation Lock, if that person is still available and is inclined to unlock this device.
Again, only the person with the credentials to the Apple ID holding the lock, or Apple, can clear this lock. For Apple to clear the lock, you will have to provide a receipt with proof of original purchase and with matching serial number or IMEI, legal paperwork from an inheritance, or other similar proof of ownership materials.
For recovering access to your own Apple ID, if you are the holder of the Apple ID associated with the Activation Lock:
If you forgot your Apple ID password - Apple Support
If you forgot your Apple ID - Apple Support
How to use account recovery when you can’t reset your Apple ID password - Apple Support
Contact Apple for help with Apple ID account security - Apple Support
If you are the heir:
How to request access to a deceased family member's Apple accounts - Apple Support
Purchasing devices with Activation Lock is unfortunately far too common. These are scams, and other fraudulent sales. These locked devices will not be useful to you, and are probably best recycled. See the following link for more info:
The All Too Common SAD Reality of Buying a Used iPad/iPhone