I managed to get it to work
Variants in FPC are... weird. They behave quite different than you would expect. Sometimes, you have to cast them: String(MyVariant) instead of using MyVariant.AsString. Often, if you tell it what type you expect, it turns into an unsupported Custom type (3) and the conversion fails. I guess you are expected to use CastTo.