@Bhuwan_B tried using both way
templateRes.adaptTo(FragmentTemplate.class).createFragment(parentFolder,
"custom-name", "Custom Title"); fragmentManager.create(parent, template,
“my-test-fragment”, “My Test Fragment”);The code runs fine but there is
no content fragment created in the DAM.