After the expiration of the patent protection, the whole people can use the "technical scheme" recorded in the patent for free.
The patent right cannot be extended after its expiration.
Whether the secret recipe is open or not depends on your own choice. If you are confident to keep it secret and the cost of keeping it secret is acceptable, you can keep it secret all the time-the formula of Coca-Cola has not been made public so far. The risk of secrecy is that once someone else has developed the same secret recipe and applied for a patent, you can't use it yourself.