In widget functions, the editing buffer is exposed in the `$BUFFER` (whole buffer) and also `$LBUFFER` and `$RBUFFER` (the part of the buffer left and right of the cursor respectively). See `info zsh BUFFER`¹ for details. So here, you'd do:
_prefill() LBUFFER+=ls
`print -z` is to prefill the buffer for the next command so is typically used _outside_ of zle widgets.
* * *
¹ you may need to install a `zsh-doc` package or equivalent as not all systems install the zsh documentation by default (other than the man pages which are not adequate for a manual this size). That documentation is also available online for the latest version. Here's the link for the corresponding `BUFFER` index entry.