In S11E20 god/Chuck has been introcuded. At first, Chuck "showed" himself to Metatron. Besides Metatron is an angel, he needs to wear sunglasses to see Chuck's light.
Why doesn't Dean need sunglasses when Chuck and Amara vanish in S11E23?
Chuck and Amara vanishing was not the same thing as Chuck showing Himself to Metatron. When they vanished, they were just "teleporting" away as a beam of light and darkness, but those weren't their true forms.
When Chuck "showed Himself" to Metatron earlier, that was Chuck proving He was really God by revealing His true form, as Metatron would have remembered Him in Heaven. Metatron needed to wear glasses for this, because according to Biblical lore, (second quoted passage) no one can look on God's face and live (not even angels.) Although it's also worth remembering that, by this point in the show, Metatron is no longer an angel, having lost his grace.
The fact that he could look on God at all, even with sunglasses, could be considered an in-universe distinction between what RL Biblical Lore says and what "the real deal" is in-universe. Supernatural's vision of Biblical lore is pretty good, IMHO, but it's definitely not 100% accurate, and I expect that's on purpose, to keep things interesting.