There is a big misunderstanding regarding the knowledge of Unseen. The reason of this misunderstanding is mixing between different degrees of the Unseen. Absolute knowledge of the Unseen is with Allah only and this is the meaning of many Quranic verse which state that the knowledge of the Unseen is for Allah. Allah grants part of the knowledge of the Unseen to His most humble servants as we read in Quran ( They know nothing from His knowledge ( of the Unseen) except whom He wants). (Al-Baqara:255).
The Prophets and their successors including the 12 Imams have from the Unseen knowledge Whatever Allah grants them from His knowledge of the Unseen. There are many Quranic verse that Allah (SWT) granted knowledge to the Prophet Muhammad (And He taught you everything that you did not know) (4:113). Many other verses mentioned other humble servants of Allah who were been granted knowledge from Allah (SWT).
So, the Absolute knowledge of Unseen is for Allah only, and the part of it which is with the Prophet (SAWA) and the twelve infallible Imams is what Allah (SAWA) Has granted them. There is big difference between the Absolute knowledge which is for Allah all the times which does not come from others, and part of it which is gifted by Allah (SWT) to His most humble servants.