Yup, it's highly recommended to avoid SMS based 2FA at all costs for this reason.
For more clarification, a SIM swap hack is a form of cyber attack where hackers fraudulently gain control of a victim’s phone number by tricking the mobile carrier.
By doing so, they can bypass two-factor authentication and gain access to the victim’s sensitive information, such as financial accounts.
https://bitcoinist.com/plugwalkjoe-gets-5-year-sentence-for-794000-sim-swap-crypto-hack-details/
Discussion
I never liked the SMS based 2FA because I always felt that "they / the government" can link my anonymous created accounts to my phone records and get my identity.
They absolutely could. Consider SMS/MMS/Phone as if it were the clearnet. Everything will be in plaintext/voice for alphabet agency.