Tested with org-mode version 9.7-pre. Looking at section 'A.7 Special Agenda Views' of the info org-manual.
It is stated that 'tags-tree' searches can set 'org-agenda-skip-function' to some function that decides on the visibilty of each match. For what I gathered, by setting up something like this, (org-add-agenda-custom-command '("b" tags-tree "some-tag" ((org-agenda-skip-function 'my-skip-function) ))) , and then calling 'org-agenda' and selecting the 'b' entry. It does not work, and 'my-skip-function' never fires after the request is made. It works for some types of special agenda views though, like 'todo', but not with 'tags-tree'. Is this a bug?