ItThe legend is not a mistakewrong (or very misleading), while the code snippet displays the correct output. In the third example, given $E$, the highlighted node in grey, $A$ and $S$ are not d-separated.
In this elementary configuration, $E$ is called a collider, and in a collider, conditioning on the common effect $E$ makes $A$ and $S$ dependent on each other. See for example this course p. 483.