Aqara Mini wirless switch (button) not registering

I have an automation to control my bedroom lights, the automation works no problem so I know that isn’t the problem,

I want to click the button on the device and it triggers the automation.
However, this doesn’t work, or works 1 in 100 times.

I have other aqara devices and they work fine (a motion sensor, water sensor, temp sensor, door sensor etc.) I only have 5-6 devices though so maybe the network isn’t strong enough?

It’s connected via Zigbee2MQTT

Why isn’t the button working properly to trigger the automation?

alias: Test Button
description: ""
triggers:
  - domain: mqtt
    device_id: 44be438654968f75a4382d5c7e43bd34
    type: action
    subtype: single
    trigger: device
conditions: []
actions:
  - action: script.hue_sunset_simulation
    metadata: {}
    data: {}
mode: single

All the devices you mentioned are end devices which do not route the ZigBee mesh.

Basically, all your devices will only speak to the coordinator directly. Your button must be far enough from the coordinator that it can only reach it once in a hundred times.

I suggest you read the excellent ZigBee guides on this forum and understand what is required to create a proper ZigBee mesh. Spoiler alert - you’re gonna need to buy some mains powered devices

Take a look at your Z2M map, especially the values displayed on the links between them - they show the quality of the link from your device to your controller.