I do the same thing all the time (2 tickets to get to one destination.
Nothing illegal unless it was on the same airline and there were various fare rules against this.
In fact, I get AC to put on my file that I am connecting on to other airlines (e.g. AF). AC checks my bag all the way through on both tickets (ie AC and AF).