Provable Accuracy Bounds for Hybrid Dynamical Optimization and Sampling