Highlighted your post gave a title "aaa" the result is an empty spoiler.
Highlighted a word in my post clicked on the spoiler did not give a title,
the editor placed it before the first spoiler, empty.
To create a spoiler you either need to not highlight anything, press the spoiler button, and insert some text manually between the inserted spoiler tags, or highlight text which is already in the editor, press the spoiler button, and that should wrap the highlighted text with the spoiler tag.
Entering a title on the whole shouldn't affect anything and is entirely optional.