This is indeed a problem (one of many) with hypothesis testing. This particular scenario is discussed in detail in the paper by Andrew Gelman and Hal Stern titled The Difference Between "Significant" and "Not Significant" is not Itself Statistically Significant
From the abstract:
The ubiquity of this statistical error leads us to suggest that students and practitioners be made more aware that the difference between “significant” and “not significant” is not itself statistically significant.
From the discussion:
Statistical significance, in some form, is a way to assess the reliability of statistical findings. However, as we have seen, comparisons of the sort, “X is statistically significant but Y is not,” can be misleading.
Reference
Gelman, A., & Stern, H. (2006). The difference between “significant” and “not significant” is not itself statistically significant. The American Statistician, 60(4), 328-331.