Trying to deploy some changes between two sandboxes, I'm facing the following error:
System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, ID do tipo de registro: this ID value isn't valid for the user: 012d0000000hJHeAAM: [RecordTypeId]
This happens when inserting a record with a specific RecordTypeId in my test class. This works just fine in the development environment, but it does not work in the QA environment after deployment.
I checked if the profile had the privileges to see the profiles, and it didn't. But even after I changed them from "available" to "selected" this error persists. I'm even able to create the object manually (New > Select Record Type > Save), so I'm not sure what is wrong here.
Has this happened to someone before? I searched for this error and most of the times people just forgot to make the RTs visible, but in my case I'm with the System Administrator profile, and I checked the visibility before.