Hello,
I think I see the issue. you did not make any reference to the parent rule. Even though the rule test worked, that may not be the case when actual logs are being ingested which explains why it did not match for you. I have made a correction to the rule for you below, please use as reference.
<group name="custom_rule,">
<rule id="100005" level="7">
<if_group>windows</if_group>
<field name="win.system.eventID">^6416$</field>
<description>Device $(win.eventdata.deviceDescription) plugged in</description>
</rule>
</group>
Please refer to the attached image, while testing, the log matched rule 60227 for windows, that means you may decide to replace <if_group>windows</if_group> with <if_sid>60227</if_sid> and it would still work as the same.
That being said, you can refer to the blog
here on testing windows event channel logs to better understand the process and catch any error while testing.
Please let me know if you require further clarification on this.