It is a rule; not an error.
You can't take the Queen because the Knight defends the Queen. True, that Knight is pinned, but this doesn't matter. The Knight defends the e3 Queen and by rule, you can't put your King in check. I have an easier way to remember this for how my mind works (maybe it will help you too)
I think of it like this: The "reason" the King can't put itself in check is because the other piece can capture it and the game ends when the King is lost, so I think of it in this order:
Imagine the white King could legally capture the e3 Queen. Now the "pinned" Knight captures the King on e3. White would lose their King and the game instantly ends. It is like the g4 Bishop is about to capture the d7 King, but it isn't in time because the white army lost their King already.
The order thing helps me think of this, but yeah, a pinned piece can still defend and so Kxe3 is illegal because it would put their own King in check where it could hypothetically be captured immediately.
Hi, in the last game I had the position shown in the screenshot. The Queen moved to e3 and my King couldn't take her. What is the reason? Cause the Knight is pinned and couldn't defend the Queen, isn't it? Why then? Thanks!!