I’m not familiar with SymPy, but in this case, I’m guessing that you need to transpose one of your arrays, either ges or kes. Here’s an example with a made-up fn:
fn(x, y, z) = y*z + x
ges = 1:5
kes = 1:5
fn.(1, ges, kes)
ges and kes are both vectors, so broadcasting will produce a vector: