What will happen if I have a patent that has been granted but later find out that someone else has applied for it before?

In this case, you hold a patent authorization certificate, but your patent does not have substantial protection rights

No one will sue you for infringement

But you can’t use your authorized patent for effective protection

If it’s just to apply for some government incentives, you can continue to pay fees and maintain the patent; if there is no use, for the sake of cost savings, you can no longer protect it. Just pay the annual fee to invalidate the patent

Theoretically, if you don’t take the initiative to defend your authorized patent, no one will declare your patent invalid, because the patent is declared invalid. You also need to pay an application fee