The dil-e shab , meaning 'midnight', is so novel/strange [badīʿ] that [the dictionaries] āṣifiyah , nūr ul-luġhāt , and Platts are all three devoid of it. Ja'far Ali Khan too, in his farhang-e aṡar , has ignored it. Although indeed, Farid Ahmad Barkati has entered it in his dictionary, and has also recorded the meaning correctly.
Mir has used this idiom in at least four places. One is in the present verse itself, and the remaining three examples are presented here. From the first divan [{356,7}]:
kareñ haiñ ḥādiṡe har roz vār āḳhir to
sinān-e āh-e dil-e shab
ke ham bhī pār kareñ
[since mishaps assault us every day, then finally
if only even/also we would cross over the spear-point of the sigh of midnight!]
In Ghalib's verse there are many excellences, but there's not the pleasure of the idiomatic meaning. The truth is that the idiomatic way in which Mir has used the expression in some verses, finds no parallels in Persian either. In [the Persian dictionary] bahār-e ʿajam two verses by Sa'ib have been noted as a 'warrant', but neither of them have what Mir's verse has. Thus a verse of Sai'b's is:
'If the arrogance of beauty prevents you from coming in wakefulness,
Then you can come into your lovers' dreams in the midnights.'
In the present verse, Mir has kept the idiomatic meaning of dil-e shab at the forefront, and has not used the idiom in its literal meaning so as to create a 'reversed metaphor' [istiʿārah-e maʿkūs]. But the theme is a fine one, that at midnight the sound of my weeping reaches the Houseless One.
Another aspect of the pleasure is that although the restlessnesses of the day are famous, and the sound of the weeping at midnight reaches the Houseless One, nevertheless the beloved pays no attention. It's possible that if the sound of the weeping didn't go into the intangible realm and become lost, but echoed in the tangible (the world), then even/also the beloved might be affected.