Not too sure what caused the runtime error, but I was able to fix the issue by using the activateOffline and the path of the agisoft.lic file in the installation folder, which was probably the correct way to be doing this anyway..
Metashape.License().activateOffline('C:\Program Files\Agisoft\Metashape Pro\metashape.lic')