Unfortunately, Canvas doesn’t save the text from the assignment’s text box once it’s locked or access is denied. If your professor reopens the assignment for you, the draft will likely not be available unless it was previously saved elsewhere (e.g., as a draft or auto-saved in another format).
I recommend reaching out to your professor to explain the situation, and they may be able to reopen the assignment for you to re-enter your work. In the future, it’s a good idea to type out responses in a separate document, such as Word or Google Docs, to prevent data loss. Typing in a browser directly is risky as the session could time out, you could hit backspace in the keyboard, or any number of things.