SMS messages are only stored on your phone, so without a backup they will be gone forever if you clear all data.
So what are you using for backups? There are stand-alone SMS backup utilities which work just fine, but I suspect that none of these will back up RCS messages, so if you use those you might have to rely on Google for backups. (I don't know how Google store RCS messages on the phone, but they have been very reluctant to allow anyone other than themselves and Samsung to use the RCS APIs, which is why I'm guessing that most utilities won't be able to back those up. RCS has been one of the least open Android features ever, and to be honest it feels like Google are trying to force people to use their Messages app for some reason).