This should be pretty straightforward to do with an IMAP <-> IMAP syncing tool, like mbsync [1]. You'd run it periodically in the background to sync the remote IMAP to Stalwart's local IMAP server, and Stalwart can then automatically serve that via JMAP, doing the translation internally.
I was originally thinking you'd need to go remote IMAP <-> maildir <-> Stalwart IMAP, which would be really complicated, but I think the IMAP <-> IMAP should work fine.
ImapGoose is on my radar to replace mbsync and imapnotify in my setup, but I think it's IMAP <-> maildir only, which makes sense for the intended use case of local mail
I was originally thinking you'd need to go remote IMAP <-> maildir <-> Stalwart IMAP, which would be really complicated, but I think the IMAP <-> IMAP should work fine.
[1] https://isync.sourceforge.io/mbsync.html