In your Terminal.app shell instance, you have defined a search path on which yabai can be found.
In the vanilla shell instance of a Keyboard Maestro Execute Shell Script action, you need to do the same (it starts afresh and doesn't automatically import settings from Terminal.app).
Alternatively, and perhaps more simply, you need to use the full path to yabai, rather than just its name.
( i.e. in Terminal, first try the incantation which yabai)