Stored procedure deadlocking itself
It's not the same advisory lock.  Your log mentions a different table oid (off by 10) for the first process as the second.  This looks like a classic deadlock situation where two processes are seeking the same locks just in a different order.  The third number in the first is 12864385 while the third number in the second is 12864395.

So my suspicion is that both processes are trying to create the same partitions, just in a different order and so they deadlock.

One thing I have found helpful in puzzling situations like this is to go through and compare one digit at a time all the way through the series of numbers because with advisory locks it is way too easy to miss one digit subtly off like this.