Script passes in CI but fails in SSH

I have a script in ./scripts/my-script that does some static code analysis and fails with status code 1 if certain conditions are not met.

This worked fine for the last ~6 months. Suddenly, I’m finding that the script always passed (with no changes to the script or .circleci config). If I SSH into the container and run the same script, it fails as expected with an error message. I am quite on what the difference is between running via SSH + CLI and between running via the yml config!

Hello!
Could you please provide the config.yml snippet where you launch this script + script snippet where it should fail?