It’s called an “air gap” and it’s there by design. In addition to creating an air gap by doing things the way your photo shows, you can also purchase a device to do the same thing which is a little neater and tidier, and has threaded fittings: https://a.co/d/dhK4skxCan the end of a condensate drain line have a hard pipe connection? I see open ended hoses dumping into laundry tubs, sump pumps, all open ended (not connected) drain lines.
Attached: HVAC condensate drain line (end of line)