Add dbname column to end of your #temptable and try this
exec sp_MSforeachdb @command1 = 'USE [?]'
,@command2='insert #temptable (Owner,Object,Grantee,Grantor,ProtectType,[Action],[Column]) EXEC master.dbo.sp_helprotect @username = ''public'''
,@command3='update #temptable set dbname=''?'' where dbname is null'
Far away is close at hand in the images of elsewhere.
Anon.