Hello Zaedsul - welcome to English Forums and thanks for registering.
Regards gave you a credible answer, but I think sentence 2 is correct as it stands.
For example: When the patient saw his Doctor, he complained of not sleeping well.
As written, the sentence covers more time than “He complained that he hadn't slept well ”. “Had not slept well” (simple past perfect) is