According to my understanding of your problem you are trying to merge two different a2l files. To get more information on the same check the comment on this thread here. And check out this documentation - Generate single A2L file for model by merging A2L files generated for top model and referenced models - MATLAB rtw.asap2MergeMdlRefs (mathworks.com).
Hope this helps!