Can't get failBuild plugin utility to work

Hey everyone - this is a continuation from my last post here regarding automatically failing a build if index.html does not exist. I’ve been working on writing a simple plugin based on this existing package that will check for a file and fail the build if it does not exist. The problem is that I cannot get utils.build.failBuild to work correctly inside of my plugin. I feel like I am close to a solution because the if statement that should be calling out a missing file is being logged correctly in the build logs, but the build passes anyway. I’ve pasted the entirety of my index.js file below (with a purposefully faulty/missing file written in), as well as my most recent build logs before that. Any help here would be greatly appreciated.

Site name - schellgames

const fs = require('fs')
const path = require('path')

module.exports = {
   onPostBuild: async ({
                        utils: {
                            build: { build },
                        },}) => {
    function fileExists(filepath, options, done) {
        if (typeof options === 'function') {
            done = options
            options = {}
        }

        if (!done) {
            return new Promise((resolve, reject) => {
                fs.stat(fullPath(filepath, options), (err, stats) => {
                    if (err) {
                        console.log("Broken");
                        utils.build.failBuild('Homepage does not exist!');
                        return err.code === 'ENOENT'
                            ? resolve(false)
                            : reject(err)
                    }
                    console.log("Homepage exists");
                    resolve(stats.isFile())
                })
            })
        }

        fs.stat(fullPath(filepath, options), (err, stats) => {
            if (err) {
                return err.code === 'ENOENT'
                    ? done(null, false)
                    : done(err)
            }

            done(null, stats.isFile())
        })
    }

    function fullPath(filepath, options) {
        const _options = options || {};
        const root = _options.root;
        return (root) ? path.join(root, filepath) : filepath
    }

    fileExists('../../dddsssddadawa.html');
},
};

7:54:57 AM: Build ready to start
7:54:59 AM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
7:54:59 AM: build-image tag: v3.6.1
7:54:59 AM: buildbot version: 2e994c874dd551982059545cd109ce3b21bce257
7:54:59 AM: Fetching cached dependencies
7:54:59 AM: Starting to download cache of 547.2MB
7:55:01 AM: Finished downloading cache in 2.442367521s
7:55:01 AM: Starting to extract cache
7:55:16 AM: Finished extracting cache in 14.832031506s
7:55:16 AM: Finished fetching cache in 17.41322811s
7:55:16 AM: Starting to prepare the repo for build
7:55:17 AM: Preparing Git Reference refs/heads/master
7:55:32 AM: Starting build script
7:55:32 AM: Installing dependencies
7:55:32 AM: Python version set to 2.7
7:55:32 AM: Started restoring cached node version
7:55:37 AM: Finished restoring cached node version
7:55:37 AM: v10.23.1 is already installed.
7:55:38 AM: Now using node v10.23.1 (npm v6.14.10)
7:55:38 AM: Started restoring cached build plugins
7:55:38 AM: Finished restoring cached build plugins
7:55:38 AM: Attempting ruby version 2.6.2, read from environment
7:55:39 AM: Using ruby version 2.6.2
7:55:40 AM: Using PHP version 5.6
7:55:40 AM: Started restoring cached go cache
7:55:41 AM: Finished restoring cached go cache
7:55:41 AM: Installing Go version 1.12
7:55:41 AM: unset GOOS;
7:55:41 AM: unset GOARCH;
7:55:41 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
7:55:41 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
7:55:41 AM: go version >&2;
7:55:41 AM: export GIMME_ENV='/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env';
7:55:41 AM: go version go1.12 linux/amd64
7:55:41 AM: Installing missing commands
7:55:41 AM: Verify run directory
7:55:43 AM: ​
7:55:43 AM: ────────────────────────────────────────────────────────────────
7:55:43 AM:   Netlify Build                                                 
7:55:43 AM: ────────────────────────────────────────────────────────────────
7:55:43 AM: ​
7:55:43 AM: ❯ Version
7:55:43 AM:   @netlify/build 8.1.0
7:55:43 AM: ​
7:55:43 AM: ❯ Flags
7:55:43 AM:   deployId: 600979a114f5000008d11eeb
7:55:43 AM:   mode: buildbot
7:55:43 AM: ​
7:55:43 AM: ❯ Current directory
7:55:43 AM:   /opt/build/repo
7:55:43 AM: ​
7:55:43 AM: ❯ Config file
7:55:43 AM:   /opt/build/repo/netlify.toml
7:55:43 AM: ​
7:55:43 AM: ❯ Context
7:55:43 AM:   production
7:55:43 AM: ​
7:55:43 AM: ❯ Loading plugins
7:55:43 AM:    - /plugins/netlify-plugin-homepage-check from netlify.toml
7:55:43 AM:    - netlify-plugin-checklinks@4.1.1 from netlify.toml
7:55:43 AM:    - netlify-plugin-a11y@0.0.12 from netlify.toml
7:55:46 AM: ​
7:55:46 AM: ──────────────────────────────────────────────────────────────────────
7:55:46 AM:   1. onPostBuild command from /plugins/netlify-plugin-homepage-check  
7:55:46 AM: ──────────────────────────────────────────────────────────────────────
7:55:46 AM: ​
7:55:46 AM: Broken
7:55:46 AM: ​
7:55:46 AM: (/plugins/netlify-plugin-homepage-check onPostBuild completed in 5ms)
7:55:46 AM: ​
7:55:46 AM: ────────────────────────────────────────────────────────────────
7:55:46 AM:   2. onPostBuild command from netlify-plugin-checklinks         
7:55:46 AM: ────────────────────────────────────────────────────────────────
7:55:46 AM: ​
7:57:10 AM: ............................................................................................................,................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
7:57:10 AM:   1053 tests
7:57:10 AM:      1 skipped
7:57:10 AM:   1053 passed
7:57:10 AM: ​
7:57:10 AM: (netlify-plugin-checklinks onPostBuild completed in 1m 23.9s)
7:57:10 AM: ​
7:57:10 AM: ────────────────────────────────────────────────────────────────
7:57:10 AM:   3. onPostBuild command from netlify-plugin-a11y               
7:57:10 AM: ────────────────────────────────────────────────────────────────
7:57:10 AM: ​
7:57:14 AM: [Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: This button element does not have a name available to an accessibility API. Valid names are: title undefined, element content, aria-label undefined, aria-labelledby undefined. (<button class="nav__modal__toggle js-nav-modal-toggle" data-target="nav__modal--sg">
7:57:14 AM:                 <svg class="ic...</button>)[Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: This button element does not have a name available to an accessibility API. Valid names are: title undefined, element content, aria-label undefined, aria-labelledby undefined. (<button class="nav__modal__close js-nav-modal-close">
7:57:14 AM:                 <svg class="ic...</button>)[Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: Anchor element found with a valid href attribute, but no link content has been supplied. (<a href="https://www.facebook.com/SchellGames" class="social__link" target="_blank">
7:57:14 AM:             <svg class="icon i...</a>)[Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: Anchor element found with a valid href attribute, but no link content has been supplied. (<a href="http://www.twitter.com/schellgames" class="social__link" target="_blank">
7:57:14 AM:             <svg class="icon i...</a>)[Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: Anchor element found with a valid href attribute, but no link content has been supplied. (<a href="http://www.linkedin.com/company/70485" class="social__link" target="_blank">
7:57:14 AM:             <svg class="icon i...</a>)[Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: Anchor element found with a valid href attribute, but no link content has been supplied. (<a href="https://www.youtube.com/user/SchellGamesTV" class="social__link" target="_blank">
7:57:14 AM:             <svg class="icon i...</a>)[Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: Anchor element found with a valid href attribute, but no link content has been supplied. (<a href="http://reddit.com/r/SchellGamesOfficial" class="social__link" target="_blank">
7:57:14 AM:             <svg class="icon i...</a>)[Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: This emailinput element does not have a name available to an accessibility API. Valid names are: label element, title undefined, aria-label undefined, aria-labelledby undefined. (<input type="email" value="" name="EMAIL" class="required" id="mce-EMAIL" aria-required="true">)
7:57:14 AM: [Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: This textinput element does not have a name available to an accessibility API. Valid names are: label element, title undefined, aria-label undefined, aria-labelledby undefined. (<input type="text" name="b_c5e7c7276a5ff4882f708aecc_8870df36c3" tabindex="-1" value="">)
7:57:14 AM: [Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: This form field should be labelled in some way. Use the label element (either with a "for" attribute or wrapped around the form field), or "title", "aria-label" or "aria-labelledby" attributes as appropriate. (<input type="text" name="b_c5e7c7276a5ff4882f708aecc_8870df36c3" tabindex="-1" value="">)
7:57:14 AM: [Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: This textinput element does not have a name available to an accessibility API. Valid names are: label element, title undefined, aria-label undefined, aria-labelledby undefined. (<input class="field " name="form-row-human-touch" type="text">)
7:57:14 AM: [Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: This form field should be labelled in some way. Use the label element (either with a "for" attribute or wrapped around the form field), or "title", "aria-label" or "aria-labelledby" attributes as appropriate. (<input class="field " name="form-row-human-touch" type="text">)
7:57:14 AM: [Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: This textinput element does not have a name available to an accessibility API. Valid names are: label element, title undefined, aria-label undefined, aria-labelledby undefined. (<input class="field" name="form-row-human-touch" type="text">)
7:57:14 AM: [Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: This form field should be labelled in some way. Use the label element (either with a "for" attribute or wrapped around the form field), or "title", "aria-label" or "aria-labelledby" attributes as appropriate. (<input class="field" name="form-row-human-touch" type="text">)
7:57:14 AM: [Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: Duplicate id attribute value "form-input-email" found on the web page. (<input class="field" name="email" type="email" id="form-input-email">)
7:57:14 AM: [Schell Games | Game Developer | AR | VR | Educational Games | Schell Games (index.html)] error 1: Duplicate id attribute value "form-input-message" found on the web page. (<textarea class="field" name="message" id="form-input-message" rows="5"></textarea>)
7:57:14 AM: 16 accessibility issues found! Check the warnings.
7:57:14 AM: ​
7:57:14 AM: (netlify-plugin-a11y onPostBuild completed in 3.9s)
7:57:14 AM: ​
7:57:14 AM: ────────────────────────────────────────────────────────────────
7:57:14 AM:   Netlify Build Complete                                        
7:57:14 AM: ────────────────────────────────────────────────────────────────
7:57:14 AM: ​
7:57:14 AM: (Netlify Build completed in 1m 30.9s)
7:57:14 AM: Caching artifacts
7:57:14 AM: Started saving build plugins
7:57:14 AM: Finished saving build plugins
7:57:14 AM: Started saving pip cache
7:57:14 AM: Finished saving pip cache
7:57:14 AM: Started saving emacs cask dependencies
7:57:14 AM: Finished saving emacs cask dependencies
7:57:14 AM: Started saving maven dependencies
7:57:14 AM: Finished saving maven dependencies
7:57:14 AM: Started saving boot dependencies
7:57:14 AM: Finished saving boot dependencies
7:57:14 AM: Started saving rust rustup cache
7:57:14 AM: Finished saving rust rustup cache
7:57:14 AM: Started saving go dependencies
7:57:16 AM: Finished saving go dependencies
7:57:16 AM: Build script success
7:57:16 AM: Starting to deploy site from ''
7:57:16 AM: Creating deploy tree asynchronously
7:57:16 AM: Creating deploy upload records
7:57:18 AM: 1 new files to upload
7:57:18 AM: 0 new functions to upload
7:57:19 AM: Starting post processing
7:57:19 AM: Post processing - HTML
7:57:19 AM: Processing form - Homepage Contact Form
7:57:19 AM: Detected form fields:
7:57:19 AM:  - contactName
7:57:20 AM:  - companyName
7:57:20 AM:  - form-row-human-touch
7:57:20 AM:  - email
7:57:20 AM:  - message
7:57:20 AM: Processing form - Support Form
7:57:20 AM: Detected form fields:
7:57:20 AM:  - game
7:57:20 AM:  - submitterName
7:57:20 AM:  - form-row-human-touch
7:57:20 AM:  - email
7:57:20 AM:  - message
7:57:22 AM: Processing form - Contact Form
7:57:22 AM: Detected form fields:
7:57:22 AM:  - contactName
7:57:22 AM:  - companyName
7:57:22 AM:  - form-row-human-touch
7:57:23 AM:  - email
7:57:23 AM:  - message
7:57:23 AM: Post processing - header rules
7:57:23 AM: Post processing - redirect rules
7:57:23 AM: Post processing done
7:57:23 AM: Site is live ✨
7:58:41 AM: Finished processing build request in 3m42.363776038s

I guess, you can use a package like throw-error - npm, which will return a non-safe exit code which will make Netlify think the build failed.

There’s also a Node.js way to do this. Call process.exit(1) which means Uncaught Fatal Exception. Read here: Process | Node.js v19.4.0 Documentation and the first answer here: What is difference between method process.exit(1) and process.exit(0) in node.js? - Stack Overflow