My bad, I found that while registering users with wp_insert_user, I had inputted $cred[‘user_password’] instead of $cred[‘user_pass’].
Found reply on https://wordpress.stackexchange.com/questions/364693/unable-to-login-after-registration?noredirect=1#comment530463_364693