What is your issue?
When running this code:
import xarray as xr
ds = xr.tutorial.load_dataset("rasm")
ds.rename({"time": "time"})
I will get the following warning:
UserWarning: rename 'time' to 'time' does not create an index anymore. Try using swap_dims instead or use set_index after rename to create an indexed coordinate.
ds.rename({"time": "time"})