It's great to hear that you were able to resolve the issue with a factory reset. As for how this happened, there could be a few reasons why your Roku TV was signed into someone else's account. Here are a few possibilities:
Someone else may have signed in to your Roku TV using their account.
Your Roku TV may have been previously owned or used by someone else.
You may have accidentally signed in to someone else's account when setting up your Roku TV.
Regardless of the cause, it's always a good idea to do a factory reset if you encounter an issue like this. This will wipe all of the settings and data from your Roku TV and give you a fresh start. And link the Roku TV to your Roku account.