A court has heard the details surrounding the death of a young aspiring police officer in Townsville.