The PE0002 warning (Schema name for table or view is not specified) is raised when creating an index on a temp table. It is (correctly) not raised when selecting from a temp table.
Repro:
CREATE TABLE #t (i INT NOT NULL);
SELECT * FROM #t;
CREATE CLUSTERED INDEX ix_t ON #t(i);
Repro:
CREATE TABLE #t (i INT NOT NULL);
SELECT * FROM #t;
CREATE CLUSTERED INDEX ix_t ON #t(i);