UPDATE:
This script is running on a remote server over ssh as part of a bigger GitHub project. The server is a google cloud VM running Ubuntu 22.04 lts. my local machine is running Debian bookworm. I have both systems fully updated.
Upon testing the script by itself in its own test file test.sh, it works fine. Apparently there is something elsewhere in the project interfering with the read command which isn't annotated in the project specifications and I can't find where it could be overidden therein. I'll have to talk with the project admins about it.