Safely connecting an solenoid/electromagnet to a switch-mode supply
I would consider using four MOSFETs in an H-bridge configuration. Connect the top of the bridge to the 9V supply, the bottom to return, and drive the diagonally-opposite MOSFETs with PWM to alternate the current flow through the ringer.

The body diodes of the MOSFETs will clamp any kickback, so ensure that you choose robust-enough parts for the task. Trying to use discrete diodes is tricky when MOSFET body-diodes are in parallel with them.

You will need to generate high-side drive for the upper bridge FETs, perhaps with another wall-wart supply having it's return referenced to the 9V high side. (You need to bring the top MOSFETs several volts above +9 in order for them to turn on.)