How is Nick's attitude toward Gatsby ambivalent even at the moment when he says goodbye to him?
It could be seen that by walking away from Gatsby can be seen as ambivalent. Gatsby is watching for any sign that Daisy needs him. This is reminiscent of Gatsby watching and reaching for the green light at the beginning of the novel.
Nick states that Gatsby was "standing there in the moonlight-watching over nothing" and knows that it would be futile to try to talk him into leaving. Gatsby is obstinate in his continued fantasy of the life he will have with Daisy. Nick's ambivalence comes from his experience with the situation. Even after the disastrous show down at the hotel, Gatsby refuses to give up his unrealistic expectations.
Nick is cognizant of this, and leaves Gatsby to his vigil.