UV promoting trichomes does make some sense, but I'm not sure.
weed isn't the only plant with trichomes, a lot of plants have trichomes, and they come in different forms, with different functions. there are even special salt-accumulating trichomes which work to make plants more salt tolerant.
and protection from IV-light is also a function trichomes have in multiple plantspecies, and seeing how they cover the important part of the plant(for reproduction), it could be they have a function in weed to protect against UV, and in that case it also makes sense the plant would make more of them with more UV.
on the other hand, I'm not completely sure protection from UV-light is an important function of cannabis-trichomes. I once had a practical about trichomes(I study plant sciences), where among others we looked at trichomes of olive. olive-trichomes are pretty clearly meant to protect against sunlight/UV, the trichomes are even shaped like little umbrella's if you look at them under a microscope.
but another clue is if you compare a young and an old leaf. young leaves are most easily damaged by too much light, so you see that young leaves are much denser packed with trichomes.
but in cannabis trichomes only appear during flower(or at least, the trichomes we're interested in, the mushroomshaped ones). so apparently they serve a function that's not relevant before fowering.
UV-light is also present before flower, and seedlings/very young plants would be more sensitive to it as well established, mature, flowering plants.
and buds are already somewhat shaded by the leaves around it, if protecting the flowers from damaging light was so important, it would be more likely that the plant would have developed more leafy buds instead of specialised trichomes(not to imply evolution has any intention/goal btw, just that more leafy buds would achieve the same goal, and that would probably develop easier/faster, since it's not such a drastic change).