I am showing only permissionable and accessible fields of an object on the UI, then I am upserting the field permissions for the selected fields for custom permission set. It works fine for some fields but for other fields, I get the error - "INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST", message: "Field Name: bad value for restricted picklist field: {fieldname}"
For example - When I tried to upsert FieldPermissions for ParentId field of Account object, the error occurred - "INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST", message: "Field Name: bad value for restricted picklist field: Account.ParentId"
Thanks in advance.