JOSM's validator doesn't warn about invalid ways like this -- see the OSM World Discord server for more info: https://canary.discord.com/channels/413070382636072960/782593988611014676/1363168377669030070