I have the same question.
We are using WP 6.0 and URL generation from a servlet to pages with custom unique names within a virtual portal doesn´t work for me either.

De servlet only finds pages in the ´real´ portal.
I have narrowed it down to the following line of code:

ObjectID oid = IdentificationMgr.getIdentification().deserialize("my.custom.page");

This works fine when calling it from a portlet but fails when calling it from a servlet in the same webapp.

please advise