I don't have a real answer but a few hints that might help solving the issue at hand:
As already stated in the comments, Ghidra still has a few issues, one example being: https://github.com/NationalSecurityAgency/ghidra/issues/193. So maybe, you should open up another issue on Github using the most recent Ghidra version and a minimum example to reproduce the issue. In my experience, the developers are very helpful and react to every opened issue.
After renaming a variable, Ghidra will re-run the analysis of the currently displayed function. In some phase of this analysis it then seems to decide to get rid of the variable you just renamed. And for some reason it then sometimes decides to introduce a new variable doing the exact same thing your renamed (and now removed) variable did before with a new name. This effectively looks as if the rename was canceled.
In my experience it sometimes help to Commit Local Names and/or Commit Params/Return (select it from the context menu of the Decompiler view). I realize, this is not a satisfying answer because I myself don't know exactly what's going on there, but from a practical perspective this solved the problem for me multiple times, so it might help you as well.