Fix CreateScheduleLibrary Failure

[#78208904] The issue revolves around the load order of ruby modules and
how the SWIG internal type management system handles that. Verbose
comments are port in place in the code to help make sure this kind of
subtle problem is not encountered again.

Please see code comments for more details.