Al-Adab Al-Mufrad, Book 33, Hadith 764 (English)

Ibn 'Abbas said, "None of you should say about a thing which he does not know, 'Allah knows it' when Allah may know that it is other than what he said and thus he (tries to) teach Allah what he does not know. That is something terrible in Allah's sight."

حَدَّثَنَا عَلِيُّ بْنُ عَبْدِ اللهِ، قَالَ‏:‏ حَدَّثَنَا سُفْيَانُ قَالَ‏:‏ قَالَ عَمْرٌو‏:‏ عَنِ ابْنِ عَبَّاسٍ‏:‏ لاَ يَقُولَنَّ أَحَدُكُمْ لِشَيْءٍ لاَ يَعْلَمُهُ‏:‏ اللَّهُ يَعْلَمُهُ ؛ وَاللَّهُ يَعْلَمُ غَيْرَ ذَلِكَ، فَيُعَلِّمَ اللَّهَ مَا لاَ يَعْلَمُ، فَذَاكَ عِنْدَ اللهِ عَظِيمٌ‏.‏

sunnah.com