After a long search, I found out the solution is really simple:
a simple check for an existing relationship will prevent an infinite loop:
FILTER NOT EXISTS {
?test rdfs:subClassOf _:b0 .
} .
which will be auto corrected by TBC to
FILTER NOT EXISTS {
?test rdfs:subClassOf _:0 .
} .
That's it, the rule will work.