Everyone would prefer to not have an army, because most of the time you don't need them but they're still expensive to maintain and when you do need them they're even more expensive. But if nobody has an army then the bad actors can form an army and take over everybody else. So everybody needs to have an army unless and until you can get global coordination working to the point where everyone de-militarizes and the moment anyone starts militarizing everyone else does the same and joins together to absolutely crush that violator. You just gotta hope they weren't able to massively militarize in secret.
The seems unlikely to ever happen, so until then you have a couple countries that get to live in the sweet spot of not having their own army but still being covered by someone else's.
The closest we've ever come to seeing this happen in real time was probably with German rearmament in the 20s and 30s, and they were telegraphing for decades what they were doing.
It does however raise the other problem - if people are willing to stand by and ignore obviously bad actors skirting closer and closer to the line, you'll have at some point a fairly big problem, and it depends on how long you waited.
That is the bigger problem of global demilitarization - the fact that non-action in the face of a violation usually plays better to a domestic audience than actually doing something. (This is a pattern that has and will play out repeatedly. That's the actual question that needs answering)
I am certain the US for instance could easily make nukes with no other country knowing about it, and that's with all the people in the US who would scream that from the rooftops if they knew.
Or you could get even more creative: make a virus in a lab, develop a vaccine / cure, vaccinate your population, release the virus. We don't even know if COVID-19 came from a Wuhan lab and even if it did it seems incredibly unlikely it was developed as a weapon. Imagine the secrecy that would be involved by a country doing so deliberately.
Between nukes / bioweapons / chemical weapons / drones / etc, a country could definitely achieve a huge edge before any other country knew what was happening. It's not 1920 anymore.
By the time you could cobble together an army any modern military would have already conquered you, especially if you have super strict civilian firearm laws like Costa Rica that make putting together defensive militias much, much harder.
Not refuting the larger point, but this part sounds questionable. For a country, rifles are easy to provision: just buy enough and keep them in well-guarded armories in strategic locations. Trained soldiers are much harder to come by.
South Korea has relatively strict gun laws and very few people own one at home. But almost every male goes through two years of military service. In case of a foreign invasion, it won't take 24 hours to summon millions of civilians, just throw each one a rifle, and there's your army.
But let's say Costa Rica had a standing army - are they going to stop that modern military from conquering them? Probably not, so why waste money on a half assed defense?