The word yajna here does not mean only a fire ritual. It means any action performed as an offering — for a higher purpose, for the well-being of others, not just for personal gain. When action is done in the spirit of yajna, it does not create bondage. When it is done for selfish ends, it ties you to its consequences.
Krishna tells Arjuna to act muktasangah — free from attachment. When the purpose of your work is larger than yourself, and you do not cling to the outcome, that work becomes a path to liberation rather than a chain.