According to the private pilot, while en route during a cross-country personal flight, he heard a "loud pop," followed by the engine losing all power. He declared an emergency, unsuccessfully attempted to restart the engine, and turned the airplane toward a golf course. During the landing, the airplane struck a tree, which resulted in substantial damage to the right wing. Postaccident examination of the engine revealed that the crankshaft gear alignment dowel, which sets the rotational alignment of the gear with respect to the crankshaft, had fractured; one half of the dowel was retained in the crankshaft and was contacting the gear, and the other half of the dowel was retained in the pilot flange hole. Examination of the fracture surface indicated that the dowel fractured in fatigue, initially in unidirectional bending that started on the side with the wear but transitioned to reverse bending fatigue before the final failure. Rub marks were observed on parts of the gear in contact with the crankshaft and along the interface between the gear and the lock plate.This evidence indicates that the bolt that fastened the crankshaft gear to the crankshaft was either not torqued to the proper value during assembly or that the bolt was torqued to the proper value but gradually lost preload due to an installation error. With insufficient preload, the gear would have placed unintended stresses on the alignment dowel, which would have resulted in wear and its eventual failure due to fatigue. Factors that could result in a loss of preload include improper installation of the lock plate or damage or debris trapped between the gear and the counterbore recess, which would prevent proper seating of the gear.An engine manufacturer's service bulletin (SB) described the proper procedure for evaluating the condition of the crankshaft and crankshaft gear and the proper procedure for attaching the crankshaft gear to the crankshaft. One step stated that after aligning the crankshaft gear with the crankshaft using the alignment dowel, the bolt should be tightened to 125 inch-lbs of torque, followed by several checks to ensure that the gear was properly seated. After those checks were made, the final step was to tighten the bolt to 204 inch-lbs of torque.Page 2 of 8 ERA17LA203Examination of the gear did not reveal any indications of deformation or debris that would have prevented proper seating of the gear against the face of the crankshaft counterbore recess. The locking tab was bent, but the bend was not aligned with the tab's plastic hinge. Presumably the bend was aligned with a flat face of the bolt head. It is likely that aligning the bolt with the flat face of the bolt head instead of with the tab's plastic hinge allowed the bolt to lose torque. It is also possible that, after applying the initial torque and checking whether the gear was properly seated, the final torque to 204 inch-lbs was not applied.In conclusion, the engine failed when the crankshaft gear alignment dowel failed, which allowed the gear to rotate independently of the crankshaft and shifted the timing of the engine's crankshaft to its camshaft, which resulted in a total loss of engine power. The alignment dowel failed due to unintended loads from the crankshaft gear, which resulted in the dowel wearing and eventually failing in fatigue. The unintended loads likely resulted from the improper installation of the crankshaft bolt and locking tab, which led to insufficient torque being applied to the bolt during installation or an eventual loss of torque during subsequent engine operation.A review of maintenance records revealed that the engine had been overhauled and that the engine failure occurred about 200 hours after the overhaul. The records did not specify compliance with the SB that provided the proper procedure for evaluating the condition of the crankshaft and crankshaft gear and the instructions for installing the crankshaft gear to the crankshaft.