One possible explanation for this behavior is that the emails have been automatically moved to the sub-folders based on the rules you've set up. However, it seems that they're not visible in your main inbox even though they should be.
To address this issue, first, double-check your Mail app's settings to ensure that emails are being sorted and moved according to your intended rules. You can review the rules you've set up and make any necessary adjustments to ensure that emails are being organized correctly.
If the emails are still not appearing in your main inbox after verifying the rules, you can try accessing the sub-folders directly to see if the emails are there. Sometimes, emails may be moved to sub-folders but not displayed in the main inbox due to sorting settings or view options.
If you've already attempted to rebuild mailboxes and restart your Mail app without success, it may be beneficial to try a few additional steps. You can try quitting the Mail app completely and then reopening it to see if that resolves the issue. Additionally, ensuring that your macOS is up to date with the latest software updates can sometimes address unexpected behavior in apps like Mail.
If the issue persists despite these efforts, it may be worthwhile to reach out to Official Apple Support for further assistance. They can provide personalized support and may be able to offer additional troubleshooting steps or insights specific to your situation.