It's hard to tell anything definite without something compilable, but
const std::set<MyEdge*>& getEdges() { return edges; }; and
const std::pair<MyNode*, MyNode*>& getEndpoints() { return nodes; }; should technically be const methods since they don't modify the class and return a const reference.
const std::set<MyEdge*>& getEdges() const { return edges; }; const std::pair<MyNode*, MyNode*>& getEndpoints() const { return nodes; }; This in combination with const_iterator might solve your constness problems.
However, your particular error might be that *it->foo() = *(it->foo())is different from (*it)->foo()