Ties and slurs look similar at first, but they mean different things.

Match the target by tying the opening C across the bar and slurring the second-bar phrase.

LilyPond manual reference

Target

Your Result

Click Check to compile and compare