How can i render webform on custom url with custom html in drupal 8
This should work if you return $webform; without rendering. Or use the webform render element, then you don't need to load the form:

return [
  'test1' =&gt; ['#markup' =&gt; '&lt;div&gt;&lt;p&gt;test1&lt;/p&gt;&lt;/div&gt;'],
  'form' =&gt; [
    '#type' =&gt; 'webform',
    '#webform' =&gt; 'webform_id',
  ],
  'test2' =&gt; ['#markup' =&gt; '&lt;div&gt;&lt;p&gt;test2&lt;/p&gt;&lt;/div&gt;'],
];