You can only cancel x+3 from borh sides (i.e. divide both sides by x+3) as long as x+3 is not zero. Here, x+3 turns out to be zero.
Fortuitously, you still get the right answer in this case! However, performing mathematically illegal operations is not valid, whatever the apparent result.