It looks like you are fully-qulaifying the call to the proc, but not the existence check. In your sample code try replacing this:
IF OBJECT_ID(N'dbo.extgen_ki_TestLoop1') IS NOT NULL
with this:
if exists (select * from Dev1_PHIL_App.sys.objects where name = N'extgen_ki_TestLoop1' and schema_id = 1)
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato