They tried this even on earth, to build a huge arboretum that was self sustaining in self isolation. Even using external power and all the rest, not only did it all ecologically go to hell fast, the people quickly psychologically couldn't handle it. Every experiment of how people can handle being isolated - even if fully supplied in every way, such as in a large cave network - but can't leave it - fails quickly.
Humans aren't made of it, even psychologically. Seems like it should be NO problem, but it is.
For example, how long could you handle being conscious in true, pure silence? Seems no problem, huh? Easy as easy can be. But guess what? The record is how long? 45 minutes! That's the longest anyone has been able to handle total silence.
How Long Could You Last in the World’s Quietest Room? The Record Is Only 45 Minutes | Video | TheBlaze.com
The author who wrote about Devil's Island (the penal camp) told of horrific torture, beating, rape, people being whipped, starved... and you know what was THE MOST feared punishment? Solitary confinement. ANYTHING but that. Rather be ripped apart, put in a hot box in the sun with no water, beaten - than put in isolation.
Humans can't handle it for long. And if confined in a space for long, even other people present, people literally go insane, desperately insane, frantically "I GOT TO GET OUT OF HERE! GET ME OUT OF HERE!!!!"
For now and into the foreseeable future, there is nothing out there but livelessness and void. Desolation. It would be almost infinitely easier to "colonize" Anartica and the oceans' bottoms than Mars. Even to build a second story level to earth.
Star Trek really is just fantasy.