Ehm...........
Romans 7:9-11
9 Once I was alive apart from the law; but
when the commandment came, sin sprang to life and I died.
10 So I discovered that the very commandment that was meant to bring life actually brought death.
11 For sin, seizing its opportunity through the commandment, deceived me and through the commandment put me to death.
It's indeed true as you say that the law gives you knowledge to sin and die, but where did the knowledge of sin & righteousness come from? Is it not the righteousness of God? Did God not know what sin was? I think he did since he was holy, but Satan came and he sinned. I... think
the Lord himself is the Law who knew good and evil before creation, thus, it came first and sin second.