Attempting to recreate the above environment, I was quickly able to recreate the problem. This stems from one or two small problems. Primarily, you have not set your collider up for interface through the
Lets have a look at the API documentation on using this method. One particular line stands out:
This function is called on Colliders marked as Trigger if and only if Physics.queriesHitTriggers is true.
Sure enough, you do not have your collider set as a trigger. Enabling "trigger" via the inspector will allow your collider to trigger the
Make sure your collider is actually there
The above solution did not immediately fix the problem on my end, but I sourced the other issue down to the physical size of my collider. Due to the particular nature of my problem, and the unexplained absence of the size variables on the example BoxCollider2D, I will make note of them now.
First and foremost, without an image on the object, you will still see an outline. I assumed this was the collider, as you can always see the outline. This assumption was wrong. When I deliberetly selected Edit Collider the collider appeared in an alternate colour, and was considerably smaller than the original outline. As it appears, my button was working, I just had to enlargen the collider to make the clickable space more available. Previously, size has also been a reflection of scale, with a value of 1 always completely filling the object. This was also an incorrect assumption, in this case, as I instead had to have a size that matched the exact size value of the object.
I would strongly suggest you perform the same check. If this does appear to be an issue, Edit Collider should also make gizmos available to drag out the size of the collider. Oddly enough, in the example provided above, the size variable is completely absent from the BoxCollider2D component. While my current version of Unity is a single version out of date, this is not something I have ever seen before, so would not advise you alter the size from the inspector.