I just ran into this with a student. We're using GitHub Classroom and GitHub Desktop, which added some complications.
Here's what I think happened. When the student cloned her repository from GitHub, the local repository was set up with two git remotes. One, "origin", pointed to the student's repository on GitHub. The other, "upstream", pointed to my instructor repository. The student's repository on GitHub is a fork of the instructor repository. I think MATLAB tries to push to all remotes and pull from all remotes when you click those menu items. Since the student does not have access to the instructor repository, MATLAB runs into an error when trying push and pull to the "upstream" remote, so it pops up a dialog box asking for a password even though that can't work.
GitHub Desktop also tries to push and pull to all remotes, even the one that the student doesn't have access to. It pops up a dialog box saying that the repository no longer exists, referring to the "upstream" remote. But the dialog box doesn't state which remote it's trying to access, so it took me forever to figure out what was wrong.
The solution was to open a terminal, change directory to the student's local repository, and use git remote remove upstream to get rid of the bad remote. The "origin" remote was left in place and had the correct URL.