You have to use $ to access the parts value, like this:
String jsltExpression = "let parts = split(.id, \"/\") { \"result\": $parts[1] + $parts[3] }";
You can try jslt expression in the playground (https://www.garshol.priv.no/jslt-demo), it gives you more feedback on errors.