When Saving for web (Legacy) a gif image with a text layer, and then clicking an existing .jpg file name on the browser, it saves it as .jpg but with the gif selective color so that the text layer wasn't included in the saved image, only the background.
Clicking an existing file while saving adopts the name of the file that was clicked upon to be the name of the file that is being saved but does not set the file format. This is a way to accidentally save a file with the wrong file extension type. If saving a GIF, the file will still be a GIF even if ".jpeg" is adopted by clicking.
Furthermore, the only way to have layers after saving is to save to a file format that supports layers. This includes PSD (Photoshop), PSB (Large Photoshop) and TIFF (Tagged Image Format). JPEG files and GIF files are flat. The closest equivalent you have for GIF with text is to save a GIF with transparency (any one color can be set as transparent).
So... assuming I'm following your post correctly, you'll want to save to a PSD first (using File Save) to have a fully editable file and then save a GIF from that using Save for Web (Legacy).