I fully support you in this matter. If such companies are allowed and not prohibited in Thailand, it means that someone needs it and someone makes a profit from it.
It is completely legal, if you yourself will not be involved in the business in which you invested. You will receive only your percentage of the profit, and you can live on any visa. Isn't that right?
Everything is possible. In Thailand, there is such a form of doing business as partnership, both with and without legal registration. It is not possible to work officially under this form.