I realized I was trying to position the start and end point using the layer coordinate system, instead I should use relative values between 0.0 and 1.0.

gradient.startPoint = CGPointMake(0, 0.5);
gradient.endPoint = CGPointMake(1.0, 0.5);

Like this it works.

Thanks for the response.

Gradients having a separate coordinate system makes total sense, but somehow always throws me.