On further debugging, I see that this function isn't returning anything
CRM_Core_DAO_AllCoreTables::getClassForTable($this->rule_table). (Line 61 Dedupe/BAO/Rule.php)
So, in getClassForTable, the list of tables doesn't include 'civicrm_view_members_1' and therefore
$entity = CRM_Core_DAO_AllCoreTables::getBriefName(CRM_Core_DAO_AllCoreTables::...
We are experiencing a similar type error on staging site running 5.21
-we have created a custom field in the civicrm profile used for site registration, e.g. that matches on a unique identifier (card Number)
-The error we are getting looks likes this :
TypeError: Argument 1 passed to civicrm_api3() must be of the type string, null given, called in /home/...
I'm wondering if using a webform might be a better solution. You could have a paginated webform using webform civicrm, that gets the data into CiviCRM. Then on the webform adnaced, do a redirect to the Drupal registration form with the email address prefilled using the Drupal Prepopulate module.