I have had this same issue with my wife since iOS 18. Her old number keeps getting associated to our text messages despite me deleting anything to do with her old number. I have verified her old number is not associated to her phone either. I have gone as far as deleting all conversations and group chats (losing 8 years of conversation) which still has not resolved the issue. It is very annoying and can sometimes prevent us from texting each other as that number is not in service anymore. I have deleted her contact completely after disabling iCloud for messages and created a new contact which works temporarily but the issue always returns. I got it to work for a couple of weeks at one point after backing up my phone and completely wiping it but again after two weeks the issue came back. Sorry I can’t help provide a solution but wanted to let it be known you are not the only person with this issue.
I theorize it has something to do with various devices attempting to sync with iCloud messages, but I have also deleted all conversation threads on my other devices and disabled iCloud messages. The issue still returns. Hopefully this can get resolved soon as it’s super annoying.