The code uses e.g cat which may be mocked/stubbed by the user and point to something else.
I'd suggest to get the real locations on startup (e.g. command -v cat or which cat) and save them for later use.
Alternative:
During startup (global scope): _BATSLIB_PATH="$PATH"
Call site: PATH="$_BATSLIB_PATH" \cat -
This resets the path and avoids macro/alias expansion