I got that message "While working on it.wiki your bot made several
errors, in fact it added interwikis for templates (such as templates for
flags) out of the <includeonly> tags, the consequence being that in the
pages which include those templates, several interwikis mistakenly link
to the template themselves."
It seems to be doing so in templates without any interwikis..so may be a
check for <noinclude></noinclude> tag in the template before adding
the links? and if not..it appends the tag? what do you think?