modal submit unknown interaction

    await interaction.showModal(modal); //ButtonInteraction

    const filter = (i) =>
        i.user.id === interaction.user.id &&
        i.customId === modal.data.custom_id;
    const modal_submit = await interaction
        .awaitModalSubmit({ filter, time: 300_000 })
        .catch(() => null);
    if (!modal_submit) return;
    await modal_submit.deferReply({ ephemeral: true });

I get a DiscordAPIError[10062]: Unknown interaction at the last line. Why? It is possible to defer modal submissions, is it?
The filter should also account for multiple users submitting modals with the same custom_id, right?
So what's the problem?

The above code is called through an interactionCreate listener.
Was this page helpful?