Open your picture with any pics editor (I usually use paint.net). Then, look for the pixel located in the last coordinate that appeared in the script (2298, 1196 in your case). Search for any problems near this pixel. There could be a 1x1 province or an enclaved province (when one province is inside another). I that case, correct that, because both things are not supported by the tool.
BTW, good looking map! Soy español de hecho
PD: It seems that Ibiza and Formentera are enclaved in the purple sea province, you should divide the sea so they have a border with at least two provinces,