HI @reiss1 Good question. This really borrows in advance from greater detail in FRM P1.T6 Counterparty credit risk (where Jon Gregory's text is authoritative). The relationship is that replacement value (aka, replacement cost) quantifies the credit risk. The most fundamental counterparty credit risk formula is given by credit exposure = max(0, value) where value is realistically approximately by replacement cost such that we could use exposure = max(0, replacement cost).
Although I could make an argument for your equity share example, the classic reference is a derivative contract. Say you have a swap with me, I am your counterparty. At inception, zero value. Time passes, say rates move against you such that you experience an unrealized loss; such a position has negative value to you, non-positive (zero?) replacement cost and you suffer no credit risk for being "underwater." You would just as soon prefer that I default!
But say instead rates move in your favor such that you are sitting on an unrealized (MTM) gain. An unrealized gain is credit risk. You have credit risk because your gain is at risk of my default to you. This credit risk can be approximately quantitative with its positive replacement value: if i do go into bankruptcy, as the surviving counterparty, the replacement cost is the value (at close-out) assigned to the position/transaction; if it is replaced with another transaction, the transaction would have this replacement value. You are whole if the survive with the replacement value/cost intact. I hope that's helpful,
P.S. I agree with you about equity in general: it goes to zero primarily as a function of market risk, when asset value drops below equity. But I can imagine many use cases in private equity. You might have a private minority equity position with positive value in an illiquid market (and positive replacement value) but additionally is exposed to counterparty risk: the small risk that the controlling equity owner etc, via legal or contractual technicalities, might default on its obligation to you.