There are a lot of possible reasons why the qmc-load and the desktop-load return different results, for example different rights in regard to any section access or accessing any files or databases or within different variables- and/or regional-settings.
In your case it may just be the creation/content of the variable: $(contador). If you look within the log - are all expected mapping tables created with the right names? Helpful might be also to show the variable-content within the progress-window and the log with statements like:
Ok, the mappings are created like expected. What happens when they are called - probably also within a loop and maybe within any iteration $(contador) is <1 or >4 or just empty respectively the variable didn't exists anymore because by let var = null(); the variable will be removed - and if any of it happens the mapping-call will fail.