it depends on what the law and the ticket say:
If the law says only that you have to have insurance and the ticket is for driving without insurance, then proof of insurance is a defense and the ticket will be dismissed.
If the law says you have to have insurance AND you have to carry proof of it, and the ticket says: Failure to carry proof of insurance, then you committed that violation and the ticket would not need to be dismissed.
Nevertheless some judge might dismiss it anyway.