I have the same issue running Xwiki 15.7 on Ubuntu 22.04. If the heading includes multiple words, only the first word is removed and the rest of the heading appears as normal text, it is not formatted as a heading.