System Events cannot work with negative process ids

I’ve discovered that System Events cannot work with negative process ids. Those are real, and seem to occur when a Mac’s uptime has gotten pretty long. Obviously, this seems to be the way the system describes ids that have rolled over an integer limit.
My specific situation is where I am working with more than one app that gives the same name, and I want to work with the frontmost. So, I get the process id of the frontmost app, and if it contains my name, that’s the process id I want to work with. If the frontmost is not a name-match, I just get the first process that does match.
Then, I use a tell process id myAppID block to work with it. It doesn’t work to try to sue a reference, since the de-reference will often talk to one of the other instances - I have to use tell process id myAppID.
Ok. That all works, and I use that extensively and successfully.
However, at some point, it appears that macOS starts assigning large scientific numbers to processes, and then even that isn’t enough and it rolls over into negative scientific numbers, like -2.124749523E+9.
Example:

tell application "System Events"
	id of every application process whose name contains "ker"
end tell
(* RESULT:
{1.914708368E+9, -2.124749523E+9}
*)

Unfortunately, it seems System Events cannot handle those “negative” process ids.
If I run the positive scientific number process id, I get expected results:

tell application "System Events"
	properties of process id 1.914708368E+9
end tell
(* RESULT:
{has scripting terminology:false, …and so on…, accessibility description:missing value, enabled:missing value, unix id:33483}
*)

But, if I run the same code for the “negative” scientific number, this is the result:

tell application "System Events"
	properties of process id -2.124749523E+9
end tell
(* ERROR: 
error "System Events got an error: Can’t get process id -2.124749523E+9." number -1728 from process id -2.124749523E+9
*)

Has anyone else seen this before? Obviously, one solution would be to restart my Mac, which I will do, but I was hoping there would be a way that System Events can be coaxed into working with these process ids. I did some searching online, and it looks like process ids are Int32, which of course have a maximum value of 2^31-1 (2,147,483,647). That matches the behavior I’m seeing, except for the fact that System Events doesn’t seem to support the rollover to negative values that macOS uses to handle overflow.
Can anyone think of a way to get System Events to work with these (legitimate) process ids?

id in AppleScriprt can be pretty general ID of
An item

Your asking for id and every item will always return a list.

You want to ask for process ids of ……
Or every process id of ………

Your then calling system events
properties of process id yourID

Just for fun try

set aApp to first application process whos id is yourID
properties of aApp

you really should use variable to get and set properties
And then use to results to test things

I know that every item returns a list. I was showing examples of the unusual application process ids that currently exist on my system.
I was hard-coding the negative id in my next example to make it clear this was a very specific issue: System Events cannot talk to negative application process ids. I didn’t want anyone to wonder if the variable was some unexpected data type (e.g. a list).
When I was actually doing this, I was using variables. I have a pretty involved script that works very reliably in normal use, but is how I discovered this System Events problem with (actual) negative process ids.
Here’s the results for your suggestion:

tell application "System Events"
	set yourID to id of (last application process whose name contains "ker")
	(*  -1.747260137E+9  *)
	set aApp to first application process whose id is yourID
	(* error "System Events got an error: Can’t get application process 1 whose id = -1.747260137E+9. Invalid index." number -1719 *)
	properties of aApp
end tell

So, unfortunately, this is indicating the same issue I posted about.
System Events refuses to recognize a negative number as a valid application process id when it comes to talking TO a process, even when System Events was the method by which the process id was obtained.

If I only want to get the properties of a process where I can do the “whose name contains” logic, I could use a reference. Unfortunately, in my case, I don’t want to talk to just ANY app that matches the name. I want to check the frontmost app, see if that matches the name, and then talk TO that specific app. But, if the frontmost does not match, I want to talk to just whichever matches. And, I have a lot I want to do with that, so I wrapped that logic into a function/handler. That cannot return a reference, since AppleScript will happily pick a non-frontmost instance of the app when it dereferences the reference. I need to go by the specific process id chosen.
So, that’s how I discovered this inability of System Events to talk to a negative process id.

Can anyone think of some way, other than a system restart to reduce uptime and process id numbers, to get System Events to talk to a negative process id?

When this happens, what are the pids for these two app versions as shown in terminal?