A JW cannot be excommunicated for the sole act of taking another believer to court. At the very most, such a JW might lose their status of being viewed as "exemplary" which could lead to a loss of some special privilege titles, but would not result in excommunication. Though, the negative stigma of having 'taken a fellow JW believer to court' can linger for a very long time, as in for a lifetime.
Regardless of the outcome from any court litigation, congregation elders are not obligated to recognise or critique decisions arising out of worldly courts, particularly those concerning private civil court disputes. Governing Body member David Splane ranted about this area of JW culture in his 2021 convention talk. JW officials want to render their own verdicts, which in some cases is to "do nothing"...
A JW could win their case against a fellow JW in worldly court, but lose the same case if it were later brought before the local JW elders. Most bodies of elders will not dabble into private business disputes beyond providing some generic biblical counsel. If elders do become more deeply involved, as the OP mentions, there are likely other factors at work, such as favourtism, selfish ambition, or simply some plain jackass elders.
To alleviate congregational angst resulting from such drama, JW literature and even their secret book for local elder's strongly emphasize formal written agreements for business matters between believers.
But of what real benefit is a formal written agreement between believers if JW elders will not help enforce it, and JW culture then discourages pursuing litigation as a means to remedy breach of contractual agreements...
In the end, the pressure from JW elders is to "let yourself be wronged" in order to avoid "bringing reproach upon the congregation's reputation" by believers disputing mere material things in a worldly public court of law.
Odd how the WT legal department can threaten litigation and drag the name of Jehovah into courts whenever it might benefit WT, as with that Lego-gate scandal, but the average JW is cautioned against seeking justice from wordly courts in situations that might besmirch the good reputation of "Jehovah's name"
JW business is tricky business.