The two instances of למה יגרע; the Temeim and Tzelophechad's daughters are written, in one sense, as if a new halachah of yerushah and Pesach Sheini was created for them based on their circumstances.
However, we know that HKBH also looked into the Torah to create the world and that all of the halachos were already there when these situations happened. It also appears by the response כן... דברת that the situation did just happen to be a circumstance that allowed the already existing halachah to be revealed.
Were these rules created in the spot or just revealed? Are there different opinions on this?