You might need to use the post_id to get the permalink. Can you check if something like this works?
add_filter( 'discourse_publish_format_html', 'wpdc_custom_discourse_publish_format_html', 10, 2 );
function wpdc_custom_discourse_publish_format_html( $output, $post_id ) {
$permalink = get_the_permalink( $post_id ) . '?embed=true';
ob_start();
?>
<iframe width="690" height="600" src="<?php echo esc_url( $permalink ); ?>" frameborder="0"></iframe>
<?php
return ob_get_clean();
}