It is entirely reasonable and expected that Hamas wouldn't REALLY want Barghouti out. But they claimed they did. It was easy for Israel to force their hand, for example, by saying publicly: We agree that Barghouti will be freed, but not people with x-number of victims on their head. Of course, the FACTS, beyond silly speculation is, that Netanyahu did not want him out, still doesn't, and expresses himself this way.
U.S. envoy to UN visits Cuba's UN Mission, a first in decades (AP)
from the article: Shalit deal to set free perpetrators of 2000 lynching of IDF reservists