It’s because in the operator precedence rules the NOT operator is evaluated before the IN operator so the compiler treats your first version as though you had written it like this.
Result := (not Name[Length(Name)]) in ['/', '\', '~'];
in an If statement the code above has selected a character but has not done anything with the character in the if state. At this point a comparison symbol or addition or subtraction is yet to follow. So an ‘in’ can easily operate without being in a set of brackets if you want the complier to act that way.
I understand, I was answering your question as to why the compiler won’t compile it without brackets around the IN part of the expression.
What I wrote is how the compiler is seeing your initial code. It sees it as if you had put brackets around the first part of the expression which is why you get the compile error.