Pihole -w domain.name not working

I don't think you are doing something wrong.

You found a bug.
Apparently this command line function was never tested inside a v6 container. v6 container uses a different base image and uses a different grep version.

EDIT:

There is already an open issue: