in case of macbooks even if something like usb port controller failed is most likely leads to board replacement as well so is high change that even if RAM is fine it could be useless because some $2 component failure
https://www.ifixit.com/News/116152/macbook-neo-is-the-most-r...
"The Neo has the same modular bits and bobs we’ve applauded in recent MacBook designs. The USB-C ports are modular, so a damaged charge port doesn’t turn into logic board work."
https://www.ifixit.com/Guide/MacBook+Pro+14-Inch+2021+USB-C+...
I've only changed a battery on that model, not the ports, so I haven't verified, but those steps are detailed enough and consistent enough with what I observed, that I believe them.