Would the sentence "我知道它，但是我忘了“ sound unnatural? As in, 'I know it, but I've forgotten it' (I learnt it sometime ago, but have now forgotten it)
We seldom say 我知道它
我知道這個/那個 may be better.
However, the best answer depends on the context.
Both "我知道它，但是我忘了" and "我知道这个，但是我忘了" sounds unnatural to me. I have no idea what you are talking about until I saw the English explanation: I learnt it sometime ago, but have now forgotten it. To me, the most natural way to say this is to say it with details, like "我知道这个，但是我忘记具体的内容" (I knew this, but now I forgot all the details) or even "我记得我看到过这件事，但是其他的都忘记了" (I know I have seen this, but I cannot remember anything else about it).
It depends on the context.
For example, if you are talking about some object you've seen before, maybe it seems weired, because in this case
忘了 is too vague for any specific meaning. You need to mention what you forgot -- maybe the place, the shape, etc.
On the other hand, if your friend is mentioning something old, and ask for your confirmation of knowning it. You have already forgot it, but suddenly think of it after this hint. Then,
我知道它，但是我忘了 seems more natural.
In Mandarin, 知道 is more complicated than "know". 道 itself mean "nature's rules". So implicitly, if you know the nature, you cannot "forget" it. It is almost similar to "enlighten".
That's why it is not proper to use 知道 for something you already know/learn/heard. You must specify the subject:
- 我听过这个说法， 但是我忘了具体的内容
- 我学过这个算法， 但（现在）我忘了。