Is there a way to check if the output from <urlutil charsetconv $datatoconvert $sourcecharset "UTF-8"> is valid UTF-8?
Indirectly; you can try to convert it (internally) from UTF-8 to ISO-8859-1 and look for errors. Given $buf:
<rex row "\?" $buf></rex><$before = $loop>
<strfmt "%!hV" $buf>
<rex row "\?" $ret></rex><$after = $loop>
<if $after gt $before>
Buffer contains invalid UTF-8 sequence(s)
<else>
Buffer is valid UTF-8
</if>
"%!hV" will decode UTF-8 to ISO-8859-1, HTML-escaping out-of-range characters. Any invalid sequences are printed as `?', so by counting `?' before and after, we can detect invalid UTF-8 if the count increases.