I’m just paraphrasing what I remember. I believe this is from a science fiction novel. But essentially it says “A king commissioned a map of his kingdom to be made. It wasn’t inclusive enough, so it was added to repeatedly until it became a useless collection of space where wild animals roamed”. Can someone remind me where this idea comes from?
This is "Del Rigor en la Ciencia", by Jorge Luis Borges. It is frequently associated with the phrase "the map is not the territory".
The plot is what you say, and the last line of the story says:
En los desiertos del Oeste perduran despedazadas Ruinas del Mapa, habitadas por Animales y por Mendigos.
This says that only broken ruins of the map remain, inhabited by wild animals and beggars, which matches your recollection.