Let $a,b$ be two distinct complex numbers and $f$ be an entire complex function, i.e. a complex function which is analytic on the whole complex plane, and $$R(f)\subset\mathbb C-\{\lambda a+(1-\lambda)b| \lambda\in[0,1]\}$$ Then $f$ is a constant function!
Comments:
With taking $g(z)=\frac{f(z)-a}{b-a}$ we may suppose that the segment is $[0,1]$.
Obviously we can't use Picard's theorem!
As you have already reduced it to the case where $g(z)$ misses $[0,1]$, consider $1/g(z) - 1$ which is now entire and misses the non-negative real line.
Take its square root (why can you do that?) it is an entire function missing the lower half plane.
Find a fractional linear transformation mapping the upper half plane to the inside of the unit disc.
Now you have an entire function that is bounded.
Apply Liouville.