[COOK-3880] Replace "raise" with "fail" to fix Rubocop error causing CI failure