Need help on error (reading fields) at the endgame

Hello, here is the github to try it: https://github.com/t3vall/campjeunes

I have an issue when I reach the end of my game. I have this: cannot read properties of undefined (reading ‘fields’), when my condition of end the game is meet during a dialogue.
What can I do to avoid this ?

Is it because of this: (Joueur.tileKindAt(TileDirection.Right, assets.tiletileMur16) ?

I think it was about my function appuisBtnAsc() which was always activated when I didn’t need them, now I added specific trigger for its activation. and there is no more Errors.
But I don’t know why.