Patient safety remains a global priority, with surgical errors—including in-hospital infections and procedural mishaps—causing over 7 million adverse events and 1 million deaths annually. This study evaluates machine learning (ML) for predicting medical error risks in the general surgery department of a Greek tertiary/university hospital. Using a 10-year dataset of 19,965 anonymized patient records (13.5% error cases, n=2,700), we applied ensemble ML algorithms via WEKA, achieving 94.3% accuracy (Random Forest) in detecting errors such as healthcare-associated infections (HAIs), medication errors, and equipment failures. Key predictors were hospitalization duration (ranked #1 via information gain) and initial diagnosis, enabling early risk flagging (e.g., post-op day 5). Compared to US benchmarks like ACS NSQIP (90% accuracy), our model outperformed by 4.3%, filling a gap in EU/Greek studies amid data silos and resource constraints. Integration with tools like the WHO Surgical Safety Checklist could enable proactive interventions, such as enhanced monitoring for prolonged stays. Limitations include retrospective biases and workflow integration challenges; ethical issues like data privacy and algorithmic fairness were addressed via anonymization and ethics approval. Future multi-center validation via federated platforms (e.g., Synapse) will ensure generalizability in resource-limited settings. By blending ML with clinician expertise, this approach shifts healthcare from reactive to proactive error mitigation, improving outcomes and reducing costs.