$polymer:stack

In my server console I have this error message:

[01:27:54] [Netty Epoll Server IO #4/ERROR]: Failed to read value ({chickensfish:{rarity:0b}}): No key $polymer:stack in MapLike[{chickensfish:{rarity:0b}}]

This triggers every time I pick up an item with my custom data on it. This is an example of how my data is applied in a loot table in my datapack 'chickensfish':

{
              "function": "minecraft:set_components",
              "components": {
                "minecraft:custom_data": {
                  "chickensfish": {"rarity": 0}
                }
              }
            }

Is there anything I can do to prevent this error message?

Continue to help post