Renaming an ID through RNA does not consistently increment either the current ID or the other ID in case of name collision. This depends on the existing order of the data-blocks before the rename happens.
As pointed out in the comment below by @campbellbarton, fixing this in one way or the other is trivial. But we have to choose one of the solution:
* Add incremented number suffix to renamed ID (this seems to be the soundest solution, as it will ensure we never silently rename a random other ID).
* Add incremented number suffix to the other ID.
Note that it should also be ensured that behavior is consistent with Outliner renaming code as well.
------------
Original Report
-----------------
**System Information**
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.60
**Blender Version**
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: `rBf6cb5f54494e`
Worked: (optional)
**Short description of error**
when we try to rename an object with an already used name,, it will rename the existing occurence, not the incoming one
**Exact steps for others to reproduce the error**
works with the default scene (with Cube, Light, Camera) :
- take the Cube, x2 clic on the name, rename it in "Camera". Enter
- the original Camera (previously named "Camera") will be renamed in "Camera.001" and the Cube will be renamed in "Camera"
I gess it should be the opposite : the incoming similar name is incremented, but the original name stays the same