If you make the changes directly through SQL you won’t trigger the order change event and that’s why the email is not being sent.
Instead of changing order via SQL you need to use some predefined function like update_status :
$ord = new WC_Order($ID); //ID of the order
$ord->update_status('completed')