(Tian mentioned this poem in the calligraphy lecture episode 174: common sense of inscription (I), and thought that the source could not be tested. )
It is also said that it is from Zhang Dai's Night Boat, but it is not sure.
I hope my answer can help you.