I solved this issue by going into Xcode > Preferences > Accounts.
I noticed I had 2 accounts - one was my business account which was properly logged in. The other was my personal account which was logged out.
I deleted my personal account.
Then everything worked properly.