Praise be to Allah, and may Allah’s peace and blessings be upon the Messenger of Allah, his family and his companions.
As to what follows:
In response to your question, we say, and with Allah Almighty lies all success:
It has been mentioned in the hadith of Abu Hurayrah (may Allah be pleased with him), that the Prophet (peace be upon him) said, “Do not curse Time, for indeed Allah is [the Creator of] Time,” and in another narration, “The son of Adam hurts Me by abusing Time, for I am [the Creator of] Time; in My Hands are all things and I cause the revolution of night and day.”
So it is not permissible for a believer to curse Time; not in a specific sense, nor in a general sense; not in a partial sense, like cursing an hour, day or month, nor in a holistic sense, like finding fault in Time; for this is all included in what the Prophet (peace be upon him) forbade.
As for what you have mentioned of verses of poetry, first we need to affirm their authenticity in attribution to Imam al-Shafi`i. Then if they have been proven authentic, the reference point should be the statement of the Prophet (peace be upon him). Perhaps the prohibition did not reach Imam al-Shafi`i, or he mentioned it as a narrative and anecdote, not as dispraise and finding fault, for describing Time with something that involves dispraise – not in the sense of finding fault, but in the sense of narrating information – is okay, as Allah Almighty says:
“…during days of misfortune.” [Fussilat 41:16]
Thus, He described the days as being misfortunate, which is a defect, but it is not mentioned as a dispraise, rather as a description of the days. And Allah knows best.