membership code question about assigning a level

Can anyone tell me why this code would not set a user to a level in membership? The surrounding logistics work (it creates a user and everything is included in the file that needs to be), but it won’t set the membership level:

$user_id = wp_insert_user($userdata);

$Membership = new M_Membership($user_id);

$level_id = 7;

$Membership->assign_level ($level_id, $fullload = true);