[Late correction: I now believe this drawing has been erroneously attributed to Cyriaco.]
.A number of different headdresses have been called the toupha, or toufa as you prefer, but we are currently concerned with the one on the statue, and will describe it a diadem with a lot of peacock feathers. It probably came from the East, perhaps Persia, which is an all-purpose explanation for various Byzantine appurtenances not otherwise explicable.
The toupha had been in use for quite a while before Justinian -- coins of Constantius II (337-361) like the gold here show him wearing one -- and notice the little thing in front that looks like the tuft on a hawk's hood.
When Justinian came along, 200 years later, it was apparently well- established as part of the emperor outfit, regardless of how silly it must have looked, and was worn when an emperor rode in procession to celebrate a triumph.
A hundred and seventy years ago, an extraordinary piece of fabric was discovered in Bamburg, Germany, in the tomb of Gunther, Bishop from 1057 to 1065, a fabric he had obtained in Constantinople. Splendidly colored, it showed a tyche -- a representation of a city, here Constantinople -- presenting presenting a toupha to the emperor John I Tzmiskes (971-976), unless it was to Basil II (976-1025) for defeating the Bulgarians, but either way it was already an antique when Gunther acquired it on pilgrimage. Gunther died on that pilgrimage, and his cloth was buried with him. The tyche seems to be dressed as a bride so this fabric is emphasizing that the Emperor is married to the City, much as Elizabeth II was given a ring as part of her coronation ceremony
John VIII Palaiologos who gave so much pleasure to artists with his dramatic hats went to the Council of Ferrara-Florence in late 1437. Now, Cyriaco who drew the first toupha pictured above, and who was a friend of John, was at the Council when it moved to Florence in early 1439. And the young painter Benozzo Gozzoli (1421-1497), being a Florentine, was there, too.
John didn't wear a toupha in Florence. Florence was a humiliation, not a triumph, and if he had worn a toupha, there would be twice as many pictures of him wearing it as there are of him wearing the melon hat. But one can imagine a variety of ways in which a young painter might have met up with Cyriaco who had recently been in Constantinople, and might have looked at his travel notes and diaries. And might have seen that image of a mounted emperor wearing a toupha.
Or young Benozzo talked to other people who had been in Constantinople and or saw other drawing. He may have made his own copies of them. He may have thought that it was a silly headdress, too, and that he could improve on it. Or he may have only understood that it was a crown with feathers. So that when he came to paint his amazing frescos for the Capello dei Magi in the Palazzo Medici twenty years later, he included the emperor John, wearing carefully curled hair, exotic Eastern robes, imperial red buskins, and a toupha -- a crown bejewelled with the rubies and pearls which John is known to have worn in Florence, and with red, white, and green feathers.
[An explanation for Benozzo Gozzoli's particular feathers is here.]