This is a really stupid little thing I put together using a custom datapack. The entity (or player) just follows the right wall, which only works if the start and the end are connected (If you start on an island, and the finish is on another).
Datapack [Download at own risk]:
http://www.mediafire.com/file/j61ov132qbhs3sh/mazesolver.zip/file