Boolean field inside node twig renders ok but does not work in if statement
In content is the render array of the field output. A boolean is probably a text in #markup. What text this is for 0/1 can be configured in the display mode. But don't try to find it there, better use for coding the node. There you get the values directly from the database.

{% if node.field_sample.value %}