If you haven't selected any articles yet, "mark as read above/below" both report "No article is selected". Once you select any article (in the session, even in a different feed) the buttons work as "mark visible articles as read".
Probably the right answer is to check if the selected article is part of the current feed or not, and raise the error if it is not.
To reproduce: reload ttrss instance. select a feed, and then select 'mark as read above/below'. Error will pop. Select an article, then change feeds. Without selecting a new article, select "mark as read above/below" and it will mark all visible articles in the new feed as read (both above and below behave identically.)