What is my error?

How come the 2nd block of code causes an error but the first block of code is ok

Please describe the error, by nature. Is it a console error or an SCT error?

It appears there is a typo in the word Success in the second function.