Write a program to process a batch of student enrollment records from an ambiguous or partially structured text file, ensuring robust error handling for missing fields. Implement process_enrollment_records(text), where records are separated by blank lines and fields may use key=value or key: value syntax with commas, semicolons, or newlines as separators. Return canonical valid records and structured errors for missing or malformed required fields: student_id, course_id, and term.
def process_enrollment_records(text):