A system undergoing heat transfer can be brought back to its initial state using refrigeraion.Here refrigeration leaves a trace in the surroundings but not in the system. Then why heat transfer process is IRREVERSIBLE.
The definition of the boundary is very important to describe a process as internally reversible or not. Although heat transfer can be considered as an "internally reversible" in some conditions, this usually is an idealization (e.g. heat transferred from a heat reservoir) and only accounts for "half of the problem", so it can not be considered as "entirely" reversible (or just reversible).
The idea of reversible does not mean just "something that can be brought back as it was", it is more close to "brought back using the reverse process without some extra help". In the problem that you described in your question the "little help" is the power to feed the refrigeration cycle (so the process is not reversible).
I suggest reading the first chapter of "Advanced Engineering Thermodynamics" - by Adrian Bejan to be familiar to some usual mistakes in heat transfer and entropy generation.