Fixes #36472.
When findAncestorByHash(block_hash, ancestor_hash, ...) is called with an unknown or null block_hash, LookupBlockIndex(block_hash) returns nullptr. The preceding check if (block && ancestor && block->GetAncestor(...) != ancestor) ancestor = nullptr; evaluates to false when block is null, leaving ancestor untouched. If ancestor_hash exists, FillBlock(ancestor, ...) evaluates to true, falsely reporting that an unknown descendant descends from a known block.
This patch updates the guard in src/node/interfaces.cpp to ensure ancestor is reset to null whenever !block || !ancestor || block->GetAncestor(ancestor->nHeight) != ancestor.
Unit test coverage is added in src/test/interfaces_tests.cpp asserting that findAncestorByHash returns false when block_hash is null, preserves height = -1 in the output struct, returns false when ancestor_hash is null, returns false when both are null, and correctly returns true for identical blocks.