I believe this is a mistake specialize-or-pattern-row. I believe that the test is groupable?incorrect, because in your case it succeeds for your two OrPatterns, and therefore the second OrPatternis replaced by the extension of the first ( ps- these are the subpatterns of the first OrPattern).
You can get around this by adding a dummy template to your second one :or, which will force it groupable?to return false:
(match
[[1 2 3]]
[(:or [_ _ 2]
[1 _ _])] :a0
[(:or [_ _ 1]
[3 _ _]
:dummy)] :a1
:else :else)
, specialize-or-pattern-row (copy-as :as OrPattern, :as ):
(defn copy-as [dest src]
(if-let [as (-> src meta :as)]
(vary-meta dest assoc :as as)
dest))
(defn specialize-or-pattern-row [row pat ps]
(let [p (first row)]
(if (identical? p pat)
(map (fn [p] (update-pattern row 0 (copy-as p pat))) ps)
[row])))