API different from Form when setting contrib status to failed for event reg
Using the API to set a Contribution's status to "Failed" does not also update its related Participant to "Cancelled", unlike when you edit via the UI.
Move business logic from Form https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/BAO/Contribution.php#L1938 to BAO as per discussion at https://chat.civicrm.org/civicrm/pl/gms1or8wyfni3q3boj8cx1ktxa