Rendering PED above NUI

Hello everyone,

I want to add ped preview on inventory with blur effect behind it, but the result I end up getting is as in the attached picture

Ped was created using the following code

function start()
    local screenX = GetDisabledControlNormal(0, 239)
    local screenY = GetDisabledControlNormal(0, 240)

    clonedPed = createPed(GetEntityModel(PlayerPedId()), nil, nil, nil, nil, false, false)

    SetEntityCollision(clonedPed, false, false)
    FreezeEntityPosition(clonedPed, true)
    SetEntityInvincible(clonedPed, true)
    NetworkSetEntityInvisibleToNetwork(clonedPed, true)
    ClonePedToTarget(PlayerPedId(), clonedPed)
    SetEntityCanBeDamaged(clonedPed, false)
    SetBlockingOfNonTemporaryEvents(clonedPed, true)
    SetEntityRenderScorched(blur, true)

    local positionBuffer = {}
    local bufferSize = 5

    AnimpostfxPlay(blur, 1, true)
    while true do
        local world, normal = GetWorldCoordFromScreenCoord(0.67135417461395, 0.7787036895752)
        local depth = 3.5
        local target = world + normal * depth
        local camRot = GetGameplayCamRot(2)

        table.insert(positionBuffer, target)
        if #positionBuffer > bufferSize then
            table.remove(positionBuffer, 1)
        end

        local averagedTarget = vector3(0, 0, 0)
        for _, position in ipairs(positionBuffer) do
            averagedTarget = averagedTarget + position
        end
        averagedTarget = averagedTarget / #positionBuffer

        SetEntityCoords(clonedPed, averagedTarget.x, averagedTarget.y, averagedTarget.z, false, false, false, true)
        SetEntityHeading(clonedPed, camRot.z + 180.0)
        SetEntityRotation(clonedPed, camRot.x * (-1), 0, camRot.z + 180.0, false, false)
        SetEntityAsMissionEntity(clonedPed, true, true)

        Citizen.Wait(0)
    end
end