The title property of draft windows is set to be the display title of the draft, prefixed with "Draft: ".
The display title is a trimmed version of the first line of the draft, so it will not change as text past the first line is altered. The trimming is essentially removing any leading or trailing whitespace and “#” characters (Markdown header characters).
Note that draft windows are not document windows, however, the title is based on whatever current draft is selected in that window, but that can change.
If you are trying to create a way to always reliably return to a specific draft open in a window, you would be better creating a workflow that opens the URL for that draft. The URL for the draft can be copied to the clipboard from the draft details screen, or via the main menu “File > Copy > Link” when the draft is open.