This statement is true in many ways, but it is not completely true.
It is true that the policy of containment suffered a number of setbacks during this time. Most notably, there were communist takeovers of Cuba and Vietnam. Both of these were seen as places that were important to the US. When they fell to the communists, it was clear that containment had failed.
However, the main goal of containment was achieved. The US continued to maintain its power and its major allies were not threatened by communism. Western Europe was not threatened. Japan and the Philippines were not threatened. The oil rich area of the Middle East was not seriously threatened. Because of this, the US was able to maintain a network of important allies in strategic parts of the world. This allowed it to keep communism essentially contained.
The US may have lost some battles during this time, but it did not lose the war. Therefore, containment did not fail.