Weird issue when upgrading to 5.12 - errors re deleting a payment processor type
The recent civi upgrade tries to disable some obsolete extensions during the process. This functionality was added in https://github.com/civicrm/civicrm-core/pull/13298

And from the comment posted at https://github.com/civicrm/civicrm-core/pull/13298#issuecomment-462961558, it seem it do provides a list of extensions that will be disabled.

The above error seems to be triggered when an extension related to payment processor type is disabled which in turn tries to remove the payment processor type attached to it.

Not completely sure, but this is what it seems from the backtrace shown.

UPDATE -it looks like there are 4 noted extensions which are checked by the above PR during the upgrade process.

uk.squiffle.kam, com.aghstrategies.slicknav, de.systopia.recentitems, and com.ixiam.modules.quicksearch.

If any of the extension is present on the site, it will try to disable them which throws the error on upgrade.

Note that none of these extensions are related to any payment processor. 

So, it must be something in your DB which mismatches with the expected values resulting into this error. Would recommend disabling these extensions manually before starting an upgrade process.