You might have ticked "Hang closing brackets" in Settings | Editor | Code Style | Python | Wrapping and Braces tab.
Settings
Editor
Code Style
Python
Wrapping and Braces
Wrapping and Braces in Settings, note the blue highlight in the example code
Untick it to unindent the closing bracket.