Macrolactonization of natural product analogs presents a significant challenge to both biosynthetic assembly and synthetic chemistry. In the preceding paper , we identified a thioesterase (TE) domain catalytic bottleneck processing unnatural substrates in the pikromycin (Pik) system, preventing the formation of epimerized macrolactones. Here, we perform molecular dynamics simulations showing the epimerized hexaketide was accommodated within the Pik TE active site; however, intrinsic conformational preferences of the substrate resulted in predominately unproductive conformations, in agreement with the observed hydrolysis. Accordingly, we engineered the stereoselective Pik TE to yield a variant (TES148C) with improved reaction kinetics and gain-of-function processing of an unnatural, epimerized hexaketide. Quantum mechanical comparison of model TES148C and TEWT reaction coordinate diagrams revealed a change in mechanism from a stepwise addition-elimination (TEWT) to a lower energy concerted acyl substitution (TES148C), accounting for the gain-of-function and improved reaction kinetics. Finally, we introduced the S148C mutation into a polyketide synthase module (PikAIII-TE) to impart increased substrate flexibility, enabling the production of diastereomeric macrolactones.