Kasa “Smart” Switch does not turn off the light
The whites and greens are pretty straightforward.
However I believe this switch has two black wires.  One of them should be identified as &quot;Line&quot; or &quot;Supply&quot;.
Also, 2 black wires went to the old switch.
I want you to connect the &quot;Line&quot; black wire to one of the 2 black wires that went to the switch - preferably the one that is nutted to other black wires.
Cap off the other 2 black wires (1 from switch 1 from wall).
Now, see if the smart switch will power up and identify itself on the Internet.  If it does, go to the next step.  If it doesn't, you got the wrong black wire.
Once the switch powers up, there you are with 2 black wires capped off and unconnected.  Connect them to each other and the light should now work.