Is Saint Zhuangzi daydreaming, bewitched by butterflies, and is the longing for love of Emperor Wang crying with the metonymy of cuckoo?

No, "Saint Zhuangzi daydreaming, bewitched by butterflies, cuckoo crowing by Wang Chunxin" is a Jinse poem. Li Shangyin, a poet, skillfully borrowed two allusions in the poem "Saint Zhuangzi daydreaming, Butterfly Bewitched, Wang Chunxin's cuckoo crowing", one was Zhuang Zhoumeng's butterfly, and the other was Du Yu's cuckoo. Not metonymy is a rhetorical device, which means that you don't directly say the name of what you want to say, but call it by the name of another thing related to it.