If I understand your algorithm correctly I think it fails on this graph (drawn on my phone, using an online implementation of Paint).
I think this is roughly the counterexample the person above was suggesting.
I think this is roughly the counterexample the person above was suggesting.
It's an edge case that should be handled, but does not prevent the general algo from working.
However, indeed it remains true that it does not find all loops, only the smallest set of loops that cover all edges.