While most near-Earth objects of significant size are largely accounted for and monitored, long-period comets like C/2023 A3 Tsuchinshan-ATLAS or C/2020 NEOWISE are always discovered mere months before they make their closest passage to Earth. This is to be expected, given the unpredictable nature and the relatively small size of these cosmic bodies, coupled with limitations in our ability to observe faint objects and different parts of the sky at all times.
The chances that such a comet would be headed directly for Earth are rather low, but not zero.
Astronomers estimate that such a collision with a large comet occurs roughly every few million years. Given that the potential does exist, however, the continued development of early warning systems and sky surveys is essential to ensure constant vigilance.