If realtor said 50K then it will probably run higher. I suppose the house could be totaled but not many people know that yet.
"Perfect information refers to the situation in which an agent has all the relevant information with which to make a decision. It has implications for several fields."
For sure, your realtor has better information than you do.
Perfect information has a value
"In decision theory, the expected value of perfect information (EVPI) is the price that one would be willing to pay in order to gain access to perfect information.[1]"
and it might be worth your while to get a consult from a Civil or Structural Engineer.
Anyway, using the search terms
$ foundation repair rehab pier beam cost
I get many pages and the Internet scuttlebutt says
kilobucks
12
2
8
10
5
8
but most of this is from just one forum.
Fortunately, they give many details with their prices
so
we need more details.
Otherwise $50K sounds high based just on these numbers and how far apart they are scattered.
Your move.