Have a look at your evaluation condition for your loop:
i += 1, n
The net result of this condition is simply that i will get incremented by 1 each loop. The comma operator has the lowest precedence so the ", n" is essentially irrelevant here. Because the loop already increments i each turn, the loop will ultimately increment i by 2 every iteration ...
I have to ask. Did you actually test your program or did you just run check50 or submit50? Or did you test with single letters and stop testing? Thorough testing of software is a critical skill.
If you test the program, the problem is obvious. Here's output from a test run:
~/go/test/pset2/ $ ./caesar 1
Please input your text:
encodedPhrase[i] = substitutionKey[j];
This code above is causing error because encodedPhrase[i] is trying to access memory space which is not allotted to it. Your code has even several logical errors such as:
It cannot detect upper case letters in user input.
It cannot detect for special characters or whitespace.
You can use the below code for reference