Print multiple email messages from Apple Mail to individual PDFs
This following AppleScript code will save single or multiple selected email messages as individual PDF files. Each PDF file will be named as the subject of the selected email message.

This solution works for me using the latest version of macOS Catalina.

tell application "Mail" to activate

tell application "System Events" to tell application process "Mail"
    repeat until frontmost
        delay 0.1
    end repeat
    tell menu bar 1 to tell menu bar item "File" to tell menu "File"
        tell menu item "Export as PDF…" to perform action "AXPress"
        delay 1 -- Value May Need To Be Adjusted
    end tell
    repeat until sheet 1 of window 1 exists
        delay 0.1
    end repeat
    if UI element "Choose" of sheet 1 of window 1 exists then
        -- When Multiple Email Messages Are Selected
        click UI element "Choose" of sheet 1 of window 1
    else
        -- When Only One Email Message Is Selected
        click UI element "Save" of sheet 1 of window 1
    end if
end tell