Time machine external disk ejects before backup is complete
This sounds like the connection to the drive is not stable.
Try using another cable and changing ports on your Mac and on your external Drive if it has multiple ports.

If the problem persists the device is probably faulty and needs to be replaced/repaired.