Yes there is nothing wrong with believing that as long as we believe God gave him that knowledge. His knowledge is not independent of Allah, it is from Allah.
There are several verses in the Quran that allude to this meaning.
وَ رَسُولاً إِلى بَنِي إِسْرائِيلَ أَنِّي قَدْ جِئْتُكُمْ بِآيَةٍ مِنْ رَبِّكُمْ أَنِّي أَخْلُقُ لَكُمْ مِنَ الطِّينِ كَهَيْئَةِ الطَّيْرِ فَأَنْفُخُ فِيهِ فَيَكُونُ طَيْراً بِإِذْنِ اللَّهِ وَ أُبْرِئُ الْأَكْمَهَ وَ الْأَبْرَصَ وَ أُحْيِ الْمَوْتى بِإِذْنِ اللَّهِ وَ أُنَبِّئُكُمْ بِما تَأْكُلُونَ وَ ما تَدَّخِرُونَ فِي بُيُوتِكُمْ إِنَّ فِي ذلِكَ لَآيَةً لَكُمْ إِنْ كُنْتُمْ مُؤْمِنِينَ
Al-Imran 45 Jesus tells people I can tell you what you hide in your homes, raise the dead, cure the sick all by the permission of Allah.
If this is allowed for Jesus, it is definitely allowed for Imam Mahdi who is a savior for all mankind.
وَ قُلِ اعْمَلُوا فَسَيَرَى اللَّهُ عَمَلَكُمْ وَ رَسُولُهُ وَ الْمُؤْمِنُونَ وَ سَتُرَدُّونَ إِلى عالِمِ الْغَيْبِ وَ الشَّهادَةِ فَيُنَبِّئُكُمْ بِما كُنْتُمْ تَعْمَلُونَ
Towba 105
This verse says do good deeds, God will see it, his prophet, and the believers.
The tafsir of believers are the imams of the Ahlulbayt.
So not only does the imam see our actions but the soul of the prophet according to the Quran.