I also posted this as a StaticArrays issue: with Julia 1.7 and StaticArrays v0.12.5:
julia> N = 14; m = SMatrix{N,N}(rand(N,N));
julia> x->x*m # works fine
#1 (generic function with 1 method)
julia> @time [x->x*g for g∈[m]]
3.018892 seconds (57.49 k allocations: 3.383 MiB, 100.06% compilation time)
1-element Vector{var"#20#22"{SMatrix{14, 14, Float64, 196}}}:
#20 (generic function with 1 method)
Why does it take 3 seconds? It seems to scale horribly, too: for N=10, I get 0.449260 seconds; for N=15, 5.230108 seconds; for N=16, 9.209356 seconds.
This is expected for large SArrays. From the README:
Note that in the current implementation, working with large StaticArray s puts a lot of stress on the compiler, and becomes slower than Base.Array as the size increases. A very rough rule of thumb is that you should consider using a normal Array for arrays larger than 100 elements.