I wanted to play Minecraft with my sister but that happened when I joined her lan game (it worked before)
In any case, this is the message that your game could not connect, restart your game.
So I don't know why it doesn't work, but it's the same for me then I bought a Minecraft server for 6 euro a month here is the link:
https://mc-host24.de/
You can also make a localhost server.
Or just spend money.
Verify versions are exactly the same.
Otherwise possibly. Think about renting a Minecraft server. For example with https://server.nitrado.net/deu/gameserver-mieten for 4 euro per month.
Unfortunately, Nitrado is very expensive, I would recommend MC-Host24.
You can rent a Minecraft server for free on aternos.org, it is even possible for the bedrock edition, if you don't want other people to find out, you can activate the whitelist
aternos is almost completely self-explanatory, even mods and plugins are available
I also had the problem the last time I played over LAN with my sister (I don't know if it was the same error message, I mean).
We were able to solve it by disabling her firewall (she was the host).
Yes, it worked, thanks