I've run into this before and I don't remember what I did to make it stop. Something changes in some file - though not any normally tracked in version control - and direct downloads stop working. On /admin/config/system/updates, I get a line about "Updating modules, themes, and layouts requires FTP access to your server." Literally just a few hours ago this was working in the more normal way. Everything is running on my local machine, the site runs in a Docker container. I don't need to use FTP to make changes to the code.
Why is this happening and what can I do to fix it?
I couldn't find the posts about this problem that I thought would be here, searching on FTP or download. Sorry for the no-doubt duplication, but maybe this will be easier for other people to find.