I want to use Set function in List package but I’m getting the below error.

here is the code:

there is a list “booleanLIst” , it already has a value added to it. Default value of variable SampleString is Text at index 0. when I’m trying to set the value at index 0 to some other string value, I’m getting the above error.
Everything is in same String format but still getting the cast error.