Why does this execute and summon command throw an error?

I am trying to summon a lightning bolt when a repeating command block detects an arrow on grass, but every time the command block runs it throws the error:

Failed to execute 'summon' on Arrow.

I'm on Minecraft Bedrock version 1.12.1.

Command:

/execute @e[type=arrow] ~ ~ ~ detect ~ ~-1 ~ grass 1 summon lightning_bolt

Solution 1:

Currently, your command is executing at all arrows which are on a block of grass with a metadata of 1; typical grass blocks don't have a metadata of 1. In order to fix this, set the value of 1 to -1, resulting in:

/execute @e[type=arrow] ~ ~ ~ detect ~ ~-1 ~ grass -1 summon lightning_bolt

The value of -1 tells Minecraft to ignore metadata instead of check for it.