It’s a known ambiguity of the script suite dating back to DEVONthink Pro 1.0 which wasn’t fixed to ensure that existing scripts, both compiled and uncompiled ones, are still compatible.
But there’s a simple workaround:
tell application id "DNtp"
repeat with theRecord in (selection as list)
set theType to ((type of theRecord) as string)
if theType is "text" then
display dialog "Text"
else if theType is "smart group" then
display dialog "Smart Group"
end if
end repeat
end tell
Contrary to the kind this does not depend on the language/localization/version.