Liang Wenbo missed a black to complete a 6-4 win over Ronnie O'Sullivan at the Masters before suffering a 6-5 defeat in the first round at Alexandra Palace.