Allowed failure of last build stage reports failed build to GitHub when cancelled?

In the Travis yaml file I want to allow the failure of the last stage of builds, so that GitHub will treat the build as passed if someone cancels it. From the page on Travis, it looks like the allow_failures rule is working based on the message on the bottom, yet the status on the GitHub PR still shows it as a failure when I cancel the job for the last stage. Is there something I’m missing?

Travis build:
GitHub PR with failed badge:
YAML file: