Birth_message, will_message not published

Hi there, I am rather a noob with HA, and I am facing an issue with MQTT birth & will messages.
Using this excellent lib https://github.com/plapointe6/CustomHADevicesCollection/ I am trying to add my esp32 based device to HA. The lib is supposed to subscribe to birth_message and will_message dispatched by mosquitto MQTT broker integration so that it publishes back the device properties to HA which in turn would automatically create an entity based on those properties.
The MQTT part in configuratoin.yaml file is set like this :

mqtt:
  broker: 127.0.0.1
  username: 'mqtt_user'
  password: 'mqtt_password'
  discovery_prefix: 'ha'
  discovery: true
  birth_message:
    topic: 'ha/status'
    payload: 'online'
    retain: true
  will_message:
    topic: 'ha/status'
    payload: 'offline'
    retain: true

The problem is, whatever I try, I am able to manually publish to ha/status topic (using MQTTfx or from the HA test UI) but the server doesn’t: these events never get fired nor retained.
If you feel to, you can have a look at this thread on Github that summarize the issue : https://github.com/plapointe6/CustomHADevicesCollection/issues/1 and where we get to the conclusion that it might be an issue related to Home Assistant.
Any advice on this ? Thanks a lot !

After many attempts and fiddling with Mosquitto add on, I found out that disabling then enabling “birth message” and “will massage” options in MQTT settings integration would do the trick. I don’t know why but it works !