The latter might work on an Android device, but not on the iPhone. If your iPhone forwards calls, you don’t have to dial *#21#. There’s a setting that shows which devices also receive your phone calls: Settings - Phone - Calls on Other Devices, and Call Forwarding.
It might be possible on an Android to spy on you without you noticing, but not on the iPhone. It would be necessary to install an app on your device.
If you’ve changed your passwords and passcodes, and there’s no app on your device that hasn’t been installed by you, no one else has access to your iPhone.