Example scenario:
An elf casts invisibility and sneaks to 5 ft on me, while I'm unaware of them. I then try to attack another elf in 30 ft with my crossbow. By RAW, I still get disadvantage because an enemy that is not incapacitated is within my 5 ft range. a