Why can a partition bound expression not include a casting operation?
You must be using PostgreSQL v11 or older.
Back then, it could only be a literal:

FROM ( { numeric_literal | string_literal | TRUE | FALSE | MINVALUE | MAXVALUE } [, ...] )

See the documentation.