Kelley (1927) constructed test validity as:
The problem of validity is that of whether a test really measures what it purports to measure, while the question of reliability is that of how accurately a test measures the thing which it does measure.
In the example provided, the test purports to measure some aspect of synonyms. The test actually (due to the misinterpretation) measures antonyms. Therefore, in the example provided, the test is not valid. If it were to argued that it was a valid test of synonyms, then you would also have to admit that it was not reliable and/or accurate.
Kelley's construction of validity remains in common use and adequate for the example provided. For a more complete view of validity, see Boag (2015).
Kelley, T. L. (1927). Interpretation of educational measurements. World Book. https://hdl.handle.net/2027/uc1.$b239527
Boag, S. (2015). Personality assessment,‘construct validity’, and the significance of theory. Personality and Individual Differences, 84, 36-44. https://doi.org/10.1016/j.paid.2014.12.039