A terminated contract part of a $39 million infrastructure program building dozens of schools around Australia's most populous state is under investigation.