I read that vegetables contain nutrients that provide natural sun protection
I think there may be some truth in this. Plants can't 'move out of the midday sun' so they need to make powerful UV protection for themselves, and it's possible that this UV protection is transferable by ingestion and absorption.