It's possible - especially on a production kernel - that CONFIG_DEBUG_FS_DISALLOW_MOUNT=y
;
which implies that though the debugfs filesystem's APIs are available, the filesystem itself isn't mounted - it's invisible. Take this into account, else the script won't work on such systems.
(Will setup a PR for this)