An idea came to mind while playing a game that involved vampires to create an illusionary sun or something that creates sunlight so that they fight while in sunlight. So if a 14th-level wizard were to create this illusion then make it real using Illusory Reality would it work?
The School of Illusion wizard's Illusory Reality feature (PHB, p. 118) states:
By 14th level, you have learned the secret of weaving shadow magic into your illusions to give them a semi-reality. When you cast an illusion spell of 1st level or higher, you can choose one inanimate, nonmagical object that is part of the illusion and make that object real. You can do this on your turn as a bonus action while the spell is ongoing. The object remains real for 1 minute. For example, you can create an illusion of a bridge over a chasm and then make it real long enough for your allies to cross.
The object can't deal damage or otherwise directly harm anyone.
So would creating the sunlight work, or would it fail since the vampires would be harmed simply because of their own weaknesses (like a person with a nut allergy if you created a giant nut) and do nothing even though it is real sunlight for the 1 minute?