Ancient Egyptians did wear more than loincloths in the winter and during the cold nights. Some paintings and decorative art on ancient artifacts does in fact show Egyptians wearing long dresses, long pants similar to leggings, and many variations of cloaks and wraps.
Linen and wool were the primary fabrics before cotton cloth was invented. The key to understanding how they kept warm during the cold nights and were able to deal with such extremes of temperature is the concept of layering. Layers of linen covered with a top layer of wool is much warmer than it may sound. Silk was also used in the Ptolemaic period.
One interesting factor not always obvious from the more famous pieces of artwork the general public may be more familiar with, is the possibility that a thin pant similar to modern-day leggings were frequently worn during cold weather, and especially by soldiers in ancient times. We only have physical evidence of this sort of garment as early as the 7th century but there are hints of these garments in ancient artwork.
There is no evidence that (very real) climate change or longterm cyclical weather changes has had such a dramatic effect that would indicate Ancient Egypt was much hotter than current day. If anything, data seems to support the opposite given rising temperatures in the desert.
Another consideration is that the artwork (like today’s artwork especially commercial types like photographs in advertisements or dress worn by characters in television and film) often showed an idealized or more fashionable version of dress. Women were shown wearing tight and more sexually appealing clothes while in reality the average commoner was wearing a long loose-fitting gown, perhaps similar to modern day traditional jalabiya (جلابيات). Capes and shawls were also very important to Egyptian culture and fashion and indeed many examples can be found in artwork.
2. Bénazeth D., Dal Prà P., “Une paire de jambières historiées d’époque copte retrouvée en Egypte”, Revue du Louvre 3, 1991.
3. Written by u/nathalielemel.