Changing a players game mode when they stand on colored wool

You were probably not standing on red wool at the time the command was run. It will give that "error" when the detect portion fails.

Your command has a problem as well. There should be no space in game mode and gamemode command should have a target. Use @s as it will target whoever executed the command.

Functioning command if player is on red wool:

/execute @a ~ ~ ~ detect ~ ~-1 ~ minecraft:wool 14 gamemode adventure @s

Another addition is you could exclude players who are already in adventure mode in the target selector:

/execute @a[m=!adventure] ~ ~ ~ detect ~ ~-1 ~ minecraft:wool 14 gamemode adventure @s

Here is the corrected command while not standing on red wool:
Failed to detect

Success:
Success