The company is not in Nevis if it's just you and you run it from Sweden.
Otherwise every Swedish person would just register a Nevis company instead of a Swedish company to save taxes and no one would have a Swedish company.
It's not illegal to set up a Nevis company and run it from Sweden, but then you have to declare it as a Swedish taxpayer and pay tax just as︀ if it was a Swedish company.
If you register the company while you're still living︁ in Sweden, you are creating a Swedish company in the eyes of the tax office,︂ and it will be treated just like a Swedish company when you move abroad. Which︃ may be fine, or it may create a tax liability.
Otherwise every Swedish person would just register a Nevis company instead of a Swedish company to save taxes and no one would have a Swedish company.
It's not illegal to set up a Nevis company and run it from Sweden, but then you have to declare it as a Swedish taxpayer and pay tax just as︀ if it was a Swedish company.
If you register the company while you're still living︁ in Sweden, you are creating a Swedish company in the eyes of the tax office,︂ and it will be treated just like a Swedish company when you move abroad. Which︃ may be fine, or it may create a tax liability.