You saw the issue when you shift to a different gateway with external antenna. If you are using ChirpStack, do you see the join uplink attempts? Are there any error shown? If there is error related to collision, the node and the gateway might be too close to each other. Put it in the next room or try to test some meters away.
You can try to full chip erase the RAK3172 then reupload a fresh RUI3 firmware, this way we can remove any firmware related issue.
Thank you, @carlrowan.
The problem was resolved after I replaced the RAK3172 chip. The join uplink is now being received by the gateway, and data is successfully reaching ChirpStack.
However, I still don’t know what was wrong with the old RAK chip. The AT commands were working fine also i did full chip erase several times and reuploaded fresh RUI3 Firmware, but the chip wasn’t sending any uplinks to the gateway.