I played around with this a bit now. Also got errors when I used to_integer() instead of to_int() (both from the functions menu).
Looks like there is something off in the modeller/validation code.
Try and see what happens if you use to_smallint or to_bigint.
Anyway: I recommend to open an internal incident for this one (since you are an SAP employee).