It sounds like your script was not linked with the Sheet.
From the Google App Scripts doc,
A script is bound to a Google Sheets, Docs, or Forms file if it was
created from that document rather than as a standalone script.
This means if you do not use Tools
-> Script editor...
in the Sheet for creating the script, it will not link to the Sheet.
From what I understand, a Standalone Script is treated as its own entity on Google Drive. This allows you to import the script if you were making a web application, for example, with the Drive REST API.
If you don't create a standalone script, then you will create the script in a project. I don't see an option to move scripts in the Script Projects Doc at the bottom under Managing files in a project
.
Therefore, if you didn't make the script in the Sheets project, you will need to copy the contents into the project. There might also be an option for setting the project associated with the Sheet.
Tools
->Script editor...
in Sheets does it open the script editor with your file open? – Matt Goodrich