Not a clear answer - it will depend on your threat model. What are the threat vectors you are trying to mitigate? Who are the adversaries?
As Vincent96 mentioned, buying the phone in this way will tie its IMEI to your identity - this is the phone hardware identifier when connected to a cellular network. This is not a problem for most folks with moderate threat models focused on surveillance capitalism. But you may want greater anonymity if you are, for example, being targeted by a hostile nationstate actor