Water Heater Flue set up

The tank WH flue (left side of pic) is reduced in size before reaching the roof. Yes I see that. Is the combining of it with the tankless WH flue (center) wrong in numerous ways? I believe it is but cannot remember exactly why?

Tankless water heaters can’t go into a chimney or any other vent system.