[1.21] Item modifier not working with macro.

$item modify entity @s weapon.mainhand {function: "set_components", components: {custom_data: {backpack: {id: $(backpack_id)}}}} My item modifier isn't working with a macro. It only works with a fixed value. Is this just how Minecraft is or am I doing is something wrong?
Continue to help post