The reason is that you are using ___
instead of _
. ___
is a pattern-matcher which can match zero or more sequences of arguments. In this example, it parses as follows: f = Null, g = Sequence[x^2 + y, x^3], x = x, y = y
.
This can be prevented if you use _
instead of ___
throughout.