That example is only for Espressif chips since it uses their SDK to provide the Matter support. Albeit Swift supports 32 bit arm chips like the RP2040 I'm not sure there is a package for the RP2040 that supports Matter. Granted if you built the connected home ip project for it perhaps that might be a good start. But it is worth noting that there are hardware requirements like bluetooth, thread, and wifi that the RP2040 on its own does not provide.
Other boards that might be worthwhile to look at:
ESP32-H2
ESP32-C6
ESP32-C3
ESP32-C2