Hi @lakshyakan,
your ProfileScript always returns only a value / string. No object.
It is possible to write from objects as strings - but probably too complex here. In addition, the UserProfile also has limits.
Maybe it makes more sense for you to divide the website into categories. In pages write...