you want to do it in [patch.crates-io] section since what you're doing doesn't change transitive dependencies to alloy core
So I fix it by adding new content but not replace them:
[patch.crates-io]
alloy-core = { git = "https://github.com/alloy-rs/core.git", tag = "v0.8.22" }
alloy-dyn-abi = { git = "https://github.com/alloy-rs/core.git", tag = "v0.8.22" }
alloy-json-abi = { git = "https://github.com/alloy-rs/core.git", tag = "v0.8.22" }
alloy-primitives = { git = "https://github.com/alloy-rs/core.git", tag = "v0.8.22" }
alloy-sol-types = { git = "https://github.com/alloy-rs/core.git", tag = "v0.8.22" }