HPCC-10543 Fix problem generating IR for libraryscopeinstance

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #5217 from ghalliday/issue10543

HPCC-10543 Fix problem generating IR for libraryscopeinstance

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>