How to search for all notes linked and backlinked to a note

OK so you essentially want to find “connected component” of the graph.

In Obsidian such “recursive queries” should be easy to do in Neo4j Graph View Plugin. It will allow to treat links as directed or bidirectional as needed.