keyword:setAttributes() can't change the case of a keyword's name, e.g. from "a" to "A", even though the user can do that in the UI.
To reproduce in LR 13.0.1 / Mac OS 14.1:
1. Download this tiny catalog:
https://www.dropbox.com/scl/fi/r17o9uf94v3plsr4i5yxs/keyword-name-bug.2023.11.29.zip?rlkey=wnvyv921u...
2. Copy the script "keyword-name-bug.lua" from the catalog folder to the Scripts subfolder in the Lightroom settings folder.
3. Open the catalog in LR. Observe it has one keyword named "a".
4. Do Scripts > keyword-name-bug, which should rename that keyword to "A" and display "true". But observe the rename fails and it returns "false" (incorrect).
5. In the Keyword List panel, right-click the keyword, do Edit Keyword Tag, and change its name to "A", demonstrating that users can change the case of keywords.
6. In the Keyword List panel, rename the keyword to "x".
7. Do Scripts > keyword-name-bug, and observe the keyword gets renamed to "A", demonstrating that the script works correctly otherwise.