Pink, red, blue or light purple discoloration sometimes occurs in home canned apples, cauliflower, pears, peaches or beets.
Keep all produce cool after harvest. When using the hot pack method, do not overcook or heat to too high a temperatures. Excessive heat changes natural food pigments. Use correct processing methods and time to reduce discoloration. Pressure canning can be used to can pears. But it can cause pink discoloration in canned pears. Water bath processing is a better method.
If the fruit grew in dry weather, it often turns pink and cannot be prevented. While the color doesn’t look right, the pears are safe to eat.
Other foods may have color changes. Garlic can become greenish or purple if it is immature or not completely dry before canning. Red beets may lose color if overcooked before canning or over-processed.
Sources: https://nchfp.uga.edu/how/can_02/pear_halved.html and https://extension.umn.edu/preserving-and-preparing/food-preservation-and-canning-troubleshooting-guide