It may have been a sting op and you did the right thing and so were not entrapped. But you could have been talking to a Nigerian scammer where they try to entrap and extort money by saying they will expose you for talking with an underage person. This is more common than you might think. You may have talking to an adult male Nigerian located in Lagos hoping to extort you.
https://www.justice.gov/usao-wdmi/pr/2023_0503_Sextortion_Indictment
good point.... didn’t think of that....really thought it was a crazed teen or more likely a sting from law authorities setting up an entrapment.