I know a one-to-one experiment has a grandiose appeal, but NASA and all sorts of other institutions work on this problem in minor steps every day. The step just aren't, on their own, media worthy or very sci-fi-ish. Heck. Antarctic bases and the ISS, and many other science ventures are essentially a testing ground for some of these things on their own.
So the partial answer is that people are doing this research. Complex interactive systems like this however are very hard to design all at once. One strategy might be to solve individual problems like having a habitat that provides all of its own oxygen and CO2 processing. Then once that is understood have one that can recycle 100% of bio-waste. Then add a long term power supply, then figure out how to make that supply a renewable one. It is a very complex process and each step will reveal new interconnections that need to be dealt with.
There are plenty of useful materials on a planetary surface, for example water. There are also many ways to take advantage of a CO2 atmosphere or oxygen from lunar rocks.
Even space stations don't need to be fully closed, for example the ISS is constantly being resupplied.
a truly sustainable civilization can successfully manage its planetary (or ship- or station-borne) ecology and protect itself from threats with advanced technology equally well, and we are wildly immature in both capacities
That's my whole point. This work is only interesting as a precursor to doing it on another planet. Nobody has any motivation to do the work and spend the money without a direct connection to transferring it to another planet.
Whenever someone says "why don't we just do it on earth first??". We will: but only as the testing phase of an actual mars colony mission.
do we not want to be resilient to e.g. solar flares, supervolcanoes, asteroid impacts/nukes/tungsten rods dropped from orbit, on Earth or Mars or anywhere