I may have posted my question too soon!
I found another web page that suggested adding 198.143.164.251 api.wordpress.org
to /etc/hosts
.
I did that, and now I can at add themes and plugins! And since WordPress isn’t giving me any errors now, I can’t replicate the issues with the debugger.
So it looks like I’ve answered my own question. Hopefully others can find my post useful.