Yikes!
Well this is a RV forum, about 99th out of the top 100 internet places to get advice about the transfer case in your Jeep.
But before you go to other sources or stay here, post everything you know.
what code(s)?
what t case is it? There’s 2 different if you’re not aware
Detailed symptoms.
(was it stuck in 4wd or not, history, conditions when it started, what did YOU do to cause this potentially, what maint has been done, etc)
They did not do anything to the transmission to make this go away. Rest assured. Or it’s not the transfer case that is the issue. Although the 8HP is pretty bulletproof
And please get the actual reasons from the shop. “they said it needed replaced” is as vague as can be.
Good luck.