Hello,
Note that the Server-level firewall rules do not apply to Azure SQL Managed Instance.
Ref : https://learn.microsoft.com/en-us/azure/azure-sql/database/firewall-create-server-level-portal-quickstart?view=azuresql
The sp_set_firewall_rule only applies to Azure SQL Database Azure Synapse Analytics
Hope this helps :)