Can’t connect to the server after updating Minecraft
Newer versions of Minecraft Bedrock often bring breaking network changes unpredictably. If you are unable to connect after updating your version, it is likely that you need to update your server version to a newer one that supports the version you’re trying to connect with.
Often, but not always, newer patch versions (e.g. 1.2.7, 1.2.8, 1.2.9) are compatible without any update needed. Look for the latest version which offers a version less than or equal to yours.
version command to check the supported Minecraft version of your server.
for Minecraft: PE v1.2.7 (protocol version 160)