You are violating the the "common-mode input voltage range", which defines the maximum and minimum acceptable voltages that may appear at the opamp's inputs, given its power supply potentials.
From the TL071 datasheet, on page 19, we find \$ V_{ICR} \$. It tells us that this range could be as constrained as ±11V, but is more typically +15V and -11V, when powered from ±15V.
You can infer that if you're really unlucky you can't take the inputs to within 4V of either supply potential, which is a real bummer if your supplies are 0V and 5V.
More likely, though are the typical values of +15V and -12V. These tell us that the manufacturer is confident that you can take your inputs all the way to the positive supply voltage, and to within 3V of the negative supply. Still rather restrictive, and this explains why the TL071 and its cousins are very ill suited for such low power supply voltages.
For inputs that lie outside of that range, the behaviour of the opamp is undefined. Most opamps' outputs just get stuck against one or the other of the supply rails.
Your particular device seems to be very forgiving. It allows you to get right down to within 300mV of the negative rail potential. If you want better performance than this, you must choose a device with correspondingly better input common mode voltage range, such as the LTC6258