Writing unit tests can help catch early bugs, but once they're done and green, I don't think anyone expects them to catch new and exotic bugs (it happens but it's so rare).
Instead they stay as a live and enforced documentation of how the target function behaves.