Two items that may be interfering with this.
1) Jupiter-X modifies the three parameters expected to 1, which may cause the above solution to fail.
2) If a course is set to purchasable, the status of the enrollment is set to pending (Util.php), with a promise that the payment would eventually be checked. This is not the case… Shortcutting this to leave the status at the completed default helped resolve this issue.