Accepted Answer

The fact that:

ParameterExpression parameter = Expression.Variable(typeof(object));

Is defined after all the body should be the clue; essentially, you simply aren't even looking at the object you pass in; you are only looking at instanceParameter, which is (in your code) simply an unassigned variable.

Basically, drop the final parameter declaration, and don't declare instanceParameter as a variable: