This belongs to the category in which an action is recorded afterward, and that later account is nothing other than the detailing of the first, general statement. How so? Scripture says, "And God created the human in His image" (Genesis 1:27). This is a general statement. After it, Scripture details the doing of it: "And the LORD God caused a deep sleep to fall, and He built up the rib" (as in Genesis 2:21-22), as explained above in section sixteen.
When the General Statement of Adam Is Followed by Its Detail
Yalkut Shimoni on Torah 21:1
מִכְּלָל שֶׁאַחֲרָיו מַעֲשֶׂה וְאֵינוֹ אֶלָּא פְּרָטוֹ שֶׁל רִאשׁוֹן כֵּיצַד, (בראשית א, כז) "וַיִּבְרָא אֱלֹהִים אֶת הָאָדָם בְּצַלְמוֹ", הֲרֵי זֶה כְּלָל. וְאַחֲרָיו פֵּרֵט מַעֲשָׂיו, (להלן פסוק כא כב) "וַיַּפֵּל ה' אֱלֹהִים תַּרְדֵּמָה וַיִּבֶן אֶת הַצֵּלָע", כְּדִלְעֵיל בְּסִימָן י"ו.