Hello! I actually ran into the same issue as you. After a lot of searching, I found that starting from Minecraft version 1.20.5, Mojang adjusted the rendering system. This change means that versions 1.20.5 and later no longer have the "overlay" folder or its internal interfaces, including RegisterGuiOverlaysEvent.java.
I really hope this post doesn't get buried, as this is genuinely important for mod development. I also hope someone incredibly skilled can solve this problem and share their solution here. Thanks in advance to everyone!