Bluetooth pairing with default passkey set manually in Bluez 5 BLE
The Bluetooth standard says that the passkey should be randomly generated and that a static key should not be used. There is a good reason for that: the ad-hoc protocol used in Bluetooth is insecure if the passkey is reused. If you don't have any input or output mechanism, you shall use "Just Works" pairing, which unfortunately does not give you any MITM protection. The security of this is technically more or less the same as when using a static passkey but without giving a false sense of security.
See https://stackoverflow.com/a/70479911/556495 for an answer to a similar question.