Sealed terrariums? Unless you mean something more complex than plants, soil, sunlight, and water?
https://laidbackgardener.blog/2019/10/14/the-worlds-second-o...
"That means it has been growing inside its bottle with no additional air, water or fertilizer for 47 years."
The 'biosphere 2' attempt at building a self-sustaining environment with humans, did not succeed.
12 years with bugs, but no mammals of course.
It's bad enough to do on Mars (or an asteroid or other solar system environment) where you can get spare parts sent over in a few years and ask ground control for answers to problems, have them simulate things on Earth or in cislunar space and put a lot of engineers on it. The more I think about it the worse it seems in our solar system -- but interstellar travelers are truly on their own.