The midi spec for notes and controllers is different. A note always sends a press value and then a release value. Ardour follows this by providing an internal toggle. The midi spec for a controller is that is sends the value it wants the device to have either some continuous value between 0 and 127 or 0-63 for off and 64-127 for on. So Ardour expects that. However, many controllers send CC values as 127 for press and 0 for release. So a press gives an on followed by an off. Many controllers allow the CC button to be set to toggle on the controller end so that the first press and release sends a 127 and another press send 0. Check your manual if this is possible on your controller.
Ardour 6.0, when it comes out, does allow Ardour to use a CC switch like a toggle even if it sends both press and release events. However, Ardour 6.0 is not even ready for testing and any new session started on Ardour 6.0 will not work in Ardour 5.12… and probably not in Ardour 6.0 release when it does come out. So that is not a solution right now.
The akai mpk mini does come with an editor which does say something about making a button or pad toggle or momentary. It does not say if this is only note on/off use or CC use as well. I don’t know if or how this would run in Linux (on wine). But for now, I suspect editing the buttons to send either note momentary or cc toggle would be the solution.