Your text tones haven’t been erased by the iOS 17 upgrade process. They’re still in your iPhone, but inaccessible.
There are two (relatively) simple way to mitigate this:
You can use GarageBand to create a custom tone (there are plenty of tutorials online which explain how to do this), and assign it as a text tone via that workflow. Note that you won’t be able to access the custom tone after the fact through the usual means, i.e., it will not appear in the menu of text tones. Therefore, don’t change the text tone to something else after you do this, because you won’t be able to set it back to your custom tone without repeating the entire GarageBand process again.
The other method is, in my opinion, even easier, but involves modifying a plist on your iPhone. To do this, you need certain utilities which run on your MacOS or Windows computer. Once modified, all your text tones will appear and function as expected.
Taking all of this into consideration, I suspect this is a bug in iOS 17. For one thing, custom ringtones still work. The GarageBand method to create and assign custom text tones still works also, it’s just that you can’t select those tones in the iOS menus after the fact. Also the nature of the fix via the plist modification is essentially correcting the omission of a field which identifies each tone as either a text tone or a ringtone.