You kind of answered your own question: let's be very generous and suppose there are 100 million inhabited systems out of those 400 billion you mentioned. That's a 4000:1 ratio of uninhabited (read: potential stripmines) to inhabited. You have any idea how much mass can be in just one system? Hell, just one gas giant? More than enough to build every ship, station, and mega-project over the last 20,000 years.
That's not even taking into account junk/reclamation planets like Bracca, Ferrix, or Lotho Minor. The thing about refined ores is that they're almost endlessly recyclable. We've already seen in 'Jedi: Fallen Order' the ships of the Clone Wars being stripped down and their resources used to build the Imperial star fleet. Then a generation later in 'Ahsoka' and 'Squadrons' that very Imperial fleet in turn begin dismantled and used to build ships for the New Republic. No doubt, many of the left-over ships & equipment of the ancient Sith Wars met a similar fate, and their base minerals have found their way into Republic, Imperial, and New Republic constructions over the centuries.
Also, as should always be remembered with questions like this: Star Wars isn't supposed to be science fiction (certainly not anything approaching "hard" sci-fi), it's a fantasy fairytale setting that happens to have lasers and spaceships. The logistics of a galaxy wide civilisation's ore consumption isn't something that really matters, or needs to be explained. It works, because it does. So no, it's never been mentioned.