Torah Temimah cites Shevuos 7b.
“And it was hidden from him” — that the tumah was hidden from him, while he knew of the kodesh or the Mikdash.
The classic case is one who knew he was tamei, forgot the tumah, and entered the Mikdash or ate kodashim — the he’elem of the tumah (while the sanctuary was known) triggers the offering.