Core/MMAPs: Replace an assert with error log

Replace an assert in PathGenerator::BuildPolyPath() about invalid poly reference with an error log.
Fixes #11493 .