Is this correct?
Yeah, basically.
Given
テストが明日を知りませんでした
Then as you say, we get テスト as a subject and 明日 as a direct object, giving us something like
The test didn't know tomorrow (???)
Which is generally not a reasonable thing to say.
With the below:
テストが明日なのを知りませんでした
We have
(I) didn't know that the test is tomorrow
Where the object of verb is the clause テストが明日なの. The most natural subject here is an implied "me", mostly because the only reading of the sentence that makes sense is one in which テストが is part of the subordinate clause.
If having a subordinate clause without an explicit verb makes you uncomfortable, it may help to think of this as テストが明日であるのを知りませんでした, which is mostly equivalent in terms of meaning. である sounds fairly stiff/academic though so なの is much more common.