It is ok on M2 with macOS 13.6.1 (Ventura). Maybe there is something specific to Sonoma ?
$ ./uname -sm
Darwin arm64
ludo@mba in ~/Downloads/cosmos-3.0.1/bin
$ ./python
Python 3.11.4 (heads/pypack1:65ac8ac, Oct 16 2023, 02:35:05) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>