I created a helloworld.cgi test script in /cgi-bin/, and it runs from the command line. I deleted an end slash from the ScriptAlias value, and I started getting 404 errors for files in /cgi-bin/ instead of 500 errors. Looking more closely at example code, I saw the ScriptAlias value ending with a slash. So, I put it back in, and I'm getting 500 errors again.
I created a helloworld.cgi test script in /cgi-bin/, and it runs from the command line. I deleted an end slash from the ScriptAlias value, and I started getting 404 errors for files in /cgi-bin/ instead of 500 errors. Looking more closely at example code, I saw the ScriptAlias value ending with a slash. So, I put it back in, and I'm getting 500 errors again.