In general, it is perhaps not advisable to feed large amounts of terrestrial foods to marine organisms because of chemistry differences that may impact organism health. One significant area where this is especially true is the composition of fat (e.g., fish oil vs lard).
It turns out, however, that earthworms are unusual in this regard, with some features of both land animals and marine organisms, so may not be as bad as, say, feeding cheeseburgers to your fish: lol
The fatty acid composition of the lipids of earthworms
https://onlinelibrary.wiley.com/doi/abs/10.1002/jsfa.2740260713
"The overall fatty acid pattern of earthworms is very unusual. It exhibits some
features which are characteristic of marine mammals and fish, and some which are
typical of monogastric herbivorous land animals. In common with the lipids of marine
animals, those of earthworms contain a preponderance of polyunsaturated fatty acids
including both linolenic acid and linoleic acid. Whereas in fish polyunsaturated acids
are predominantly ofthe linolenic (W3) series3 and include 20 :5W3 and 22 :6W3, in land
animals fatty acids of the linoleic (W6) type including small amounts of arachidonic
970 R. P. Hansen and Z. Czochanska
acid (20 :4W6) are characteristic.329 33 In earthworms, however, the fatty acids present
in greatest amount in the total lipids were 20:5W3 (mean 13.6%) and 20:4W6 (mean
12.3 %), for which linolenic and linoleic acids respectively are precursors. These precursors
are not synthesised within the animal33 but are of exogenous origin. A feature
common to the fatty acid constituents of earthworms and land animals, but in contrast
with those of fish, is the low level of docosa-4,7,10,13,16,19-hexaenoic acid which
typically is present in substantial proportions in marine life."