When killing mobs with looting sword on offhand and attacking with non-looting sword, they drop little to none items compared to when using the looting sword on mainhand. It is said that looting should work when the mob is killed while holding the sword.
It's because the Looting enchantment will only occur if the item is in your Main Hand. It can only work by using commands to modify the item. As proof, hover your cusuor over your item and it should say 'When in Main Hand:" and the damage from the item (as I don't know what type of sword you're using) and it's enchantment. By using the commands by using {Slot:"offhand"} in the command, then the looting will work. Sadly this doesn't work without cheats enabled on survival 😞