The aggregate output of philosophy as a process for negotiating a shared understanding of "what is true and what to do about it" is the foundation upon which societies thoughts rest. If that makes sense?
They are quite linked though. And there isn't any escaping philosophy regardless of you feel about it. Re: the replication crisis - we have found that the very foundation we thought was Rock solid doesn't appear to hold for the social sciences. The "how do we know?" has fundamentally come in to question and we find ourselves back at epistemology searching for another suitable way to be sure about things.
But I agree it's not a foundation for science per se. Just a foundation for forming belief systems. Philosophy is capable of producing all kinds of nonsense. And indeed it has and does all the time.