I have created a custom object with several fields in which one of the field is of type lookup to the reference to the User object. When I created a tab to add records to this object, I can only see all the other custom fields except this User lookup field. I ma logged in as System Administrator which should have access to that User object.
I'm not 100% sure if this is how things work (because I haven't used sfdx in this capacity), but...
When you create a new field on an SObject, and deploy that field to another org, the permissions for that field are generally not transferred to the receiving org.
Long story short, unless you know for a fact that you're deploying profile data too1, you'll need to at the bare minimum set the Field Level Security (FLS) for the new field in your receiving org.
By default, a field2 deployed to a new org has the FLS set to disallow everyone (even sysadmins) from reading or writing the field. You'll be able to see the field in the object manager (in the setup menu) but not be able to see it on layouts (or even query it, for that matter).
I have a feeling that this also applies to fields created in a scratch org and then deployed to another org, as well as fields created "directly" as xml files in an SFDX project (if you're crazy enough to do that).
One more time for clarity:
- If you create a field via the web UI of Salesforce, you have the chance to set FLS when you create the field
- If you deploy a field to an org, setting the FLS is something you need to do as well (and is typically a separate step from deploying the field)
1: or a PermissionSet, and you've already assigned the permission set to users in the receiving org
2: With the possible exception of formula fields