If I use the command
/execute if block ~ ~ ~ NotABlock run say hi
I get the attached error message.
It says that the error is located at the end of the command. I think it schould'nt say NotABlock run say hi <--[HERE]. It should say NotABlock <-- [HERE] because the error is there and not at the end of the command.
It fails to parse "NotABlock" and everything after it because it is still searching for a block type.