Why is this command not working properly?

Fill needs two sets of coordinates, one for each corner of the box you want to fill. Try this:

/execute @p ~ ~ ~ fill ~-2.5 ~-2.5 ~-2.5 ~2.5 ~2.5 ~2.5 minecraft:air