If I have this on my XSLT :
ametys:contentMetadata($userId, 'illustration')
and if illustration is not set : then I have error on logs.
I suggest to log this information with another level, or to add a method in order to test the presence of data.