I searched for this bug, did not find it. Sorry, it’s a bit complicated.
Edited: using version 3.1.5, on MacOS.
Using a text editor (BBEdit), I generated a large collection of keywords and organized them in three groups. I did that so I could alphabetically sort each group of child keywords before moving them to Scrivener. Scrivener word sort them all en masse. One at a time, I created a Parent keyword node in the Scrivener Project Keywords window. Then I pasted the relevant subset of child keywords into the Project Keywords window, then dragged them into position beneath their Parent. Success for all three Parent groups.
Now I find that, for one of these parent nodes, when I try to apply a child keyword to the current document, it inserts the Parent keyword instead. Oddly, this only happens for a subset of the child keywords in that group (9 of 22). This happens if I use the Gear dropdown menu > Add Keyword > Parent Keyword > child keyword. And also if I drag and drop the child keyword from the Project Keyword window to the Keywords pane in the document inspector.
Debugging: for the buggy group, I selected all 22 child keywords in the Project Keywords window, then dragged them to the Keywords pane in the inspector. Only one of the child keywords showed up in the inspector pane. I tested that for the other two groups of keywords and Scrivener applied all keywords, as expected.
This bug might be related to the fact that some of the child keywords were already being used before I made the three groupings. But I was careful to omit those particular keywords before pasting in the new list. Once the relevant keyword group was created, I drag and dropped the pre-existing keywords under the parent.
I am wondering how to fix this. It might be OK to delete all of the keywords in buggy group from the Project, including the parent keyword, and start over. I don’t have a large database yet, could reapply the keywords as needed.