Postgres wait_event_type Extension
I discovered that the wait_event_type: Extension was referring to it getting locked up in a query passed to the foreign data wrapper.  However, the problem does not seem to be the Postgres_FDW, but rather using Language SQL to write my function and not using LANGUAGE plpgsql.  I recalled a post either here, on StackOverflow, or another forum which mentioned a bug in the SQL procedural language in Postgres that would unexpectedly lock up queries intermittently. I rewrote the function in plpgsql, which was very simple, and it has been working flawlessly for over 3 months now.  I wish I could find the thread that mentioned the bug, but they had said it had been reported to Postgres, and the likelihood of them fixing it was slim.  Just use LANGUAGE plpgsql for your functions and stay away from the LANGUAGE SQL.