The verse is incomplete but it can be interpreted in the same sense based on the context of revelation you choose. This is the full verse:
يَٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُواْ لَا تَسَۡٔلُواْ عَنۡ أَشۡيَآءَ إِن تُبۡدَ لَكُمۡ تَسُؤۡكُمۡ وَإِن تَسَۡٔلُواْ عَنۡهَا حِينَ يُنَزَّلُ ٱلۡقُرۡءَانُ تُبۡدَ لَكُمۡ عَفَا ٱللَّهُ عَنۡهَاۗ وَٱللَّهُ غَفُورٌ حَلِيمٞ
O you who have believed, do not ask about things which, if they are shown to you, will distress you. But if you ask about them while the Qur'an is being revealed, they will be shown to you. Allah has pardoned that which is past; and Allah is Forgiving and Forbearing.
I am familiar with two contexts, in one someone asked Mohamed about the identity of his father and Mohammed revealed his mother had premarital sex.
The other was linked to the verse after that,
قَدۡ سَأَلَهَا قَوۡمٞ مِّن قَبۡلِكُمۡ ثُمَّ أَصۡبَحُواْ بِهَا كَٰفِرِينَ
A people asked such [questions] before you; then they became thereby disbelievers.
Which is related to disbelievers leaving the religion after not receiving satisfying answers.
Interpretations based on the second context make more sense because they are consistent with the meanings of the verses that follow.