I received this error when packaging the project, and I found a solution that I would like to share with you.
AutomationTool exiting with ExitCode=6 (6)
If your project file is on your desktop, move it to the same folder as your other Unreal projects. I hope this helps!