A major manhunt is underway in western Sydney after a convicted rapist fled custody while receiving medical treatment.