I kind of agree with everyone and I agree with joeldf that this may not get what you want. I have Verizon and a while back I had a device that was known to have an FM tuner built in that every other person who had it on other carriers could use but Verizon still blocked it even on my unlocked device simply by means of having their SIM installed. More recently the issue was Find My Mobile, a Samsung product, that was blocked by Verizon. They eventually removed the block but this was something just because of using their SIM or having their service.
I guess I have a question and a suggestion.
Why do you want to turn it off? I'm assuming that AT&T is similar to Verizon in the fact that if you want the truly fast 5G it would come at a price but they are giving away a version of it included with the plan. So if not because of cost what are the ill effects if it's on or not?
As for my suggestion, if this is a thing, turning off 5G, on this device and you've seen where others have done it or are doing it, then it very likely that you would not be the first to seek out this solution and you'd likely find someone that could answer if it even works with branded devices that have been unlocked. Probably in the Moto forums.
Lastly I can't imagine them cutting off service for unlocking the device but as in the examples I've given it may cause issues with other services or features of the device and probably won't get rid of the bloatware that came with the branded device. So there may actually be other downfalls... well "downfalls" is probably too harsh, maybe "unexpected" side effects is better... especially if you've never gone unlocked before. Well besides the naturally occurring unlock that happens a few months into most carrier plans.
Hopefully you'll let us know what you decide and how it turns out.