Use the below GMN snippet for rendering (see screenshot for render with latest GuidoEditor). Two problems:
(1) Alterations (bémols) should neither collide with prior Clef nor with barline.
(2) The second set of alterations should NOT be repeated over the next measure since they are retained through Slurs.
{ [ (* meas. 1 *) \key<0> \meter<"2/4"> \clef<"f4"> _ _/8 \clef<"g2"> \stemsUp \slurBegin:1 { \tieBegin g& \tieBegin, b& \tieBegin, d&2 } \bar (* meas. 2 *) { g&1/2 \tieEnd, b& \tieEnd, d&2 \tieEnd } \slurEnd:1 \bar ] }