Not an answer to your question but I asked this here and waiting for an official answer:
Dynamic downcasting from any is currently not supported. This isn’t limited to maps or arrays, but generally. I hope we’ll get that feature before we get the new verse virtual machine update in 2024.