The law was passed to secure the backing of Catalan separatist parties so Mr. Sanchez could remain in power after Spain's inconclusive 2023 general election