Improved error handling and reporting when patient merge fails