Trying to create user programmatically, running into issues
Drupal's anonymous and authenticated roles don't get saved in the users_roles table and you don't need to add the role yourself, all users are by default authenticated. Try editing your user in the backend, you'll see that it has authenticated checked off.
The code you list above where you send the roles array in the $edit will work fine with any other role.