The error is because you were passing grepl() a vector. The result is "TestedMatch" and not TRUE, because you've specified the string in the case that they match.
Note that the arguments for str_detect() are not in the same order as those for grepl().
suppressPackageStartupMessages(library(tidyverse))
test <- tibble(
Q3 = c("CH", "EN", "NA", "FR", "IN"),
Q8 = c("NA,ch", "AA,DL", "NA,DL", "na,DL", "NA,DL")
)
test1 <- test %>%
mutate(status = if_else(str_detect(tolower(Q8), tolower(Q3)), "TestedMatch", Q3))
test1
#> # A tibble: 5 x 3
#> Q3 Q8 status
#> <chr> <chr> <chr>
#> 1 CH NA,ch TestedMatch
#> 2 EN AA,DL EN
#> 3 NA NA,DL TestedMatch
#> 4 FR na,DL FR
#> 5 IN NA,DL IN