Fish that die on magma drop cooked fish. Other mobs don't. I believe that this is a bug because magma shouldn't do this and it is annoying (at least for me).
How to re-create:
1) Make ray's fish farm (https://www.youtube.com/watch?v=FQvRS1_64QA).
2) Either AFK at the farm or spawn in fish using spawn eggs/buckets of fish.
3) Go to the collection and see that the fish are all cooked.
Unable to reproduce. Make sure you aren't using any mods or datapacks that modify drops.