Craft CMS V3 Create New User
Take a look at Craft's own UsersController->actionSaveUser().

You're probably looking for something closer to this:

$user = new craft\elements\User();

$user-&gt;firstName = $firstName;
$user-&gt;lastName = $lastName;
$user-&gt;username = $userName;
$user-&gt;email = $email;
$user-&gt;password = $password;

if ($user-&gt;validate(null, false)) {
    Craft::$app-&gt;getElements()-&gt;saveElement($user, false);
}