This would take a complete rewrite for the general case where expenses may be shared at different percentages per person. But if the choices are 100% or equally shared, here is a crack at it:

To indicate someone has the entire expense, in column A of the Expenses table add " - " followed by the person's name. They don't have to be the one who paid for it (the name in column C may be different). Make sure not to use the three characters " - " in that order anywhere else in the name of the expense. I could have written the formula to handle that but it would have been more complicated.
Expenses table:
E2 =IF(COUNTMATCHES($A2," - ")>0,0,D2÷COUNTA(People::A))
fill down to complete the column
If the expense has " - " in it then the shared expense is 0, otherwise it uses the same formula as the original template.
People table:
I unhid the % Owed column. You can hide it again later. I needed to be able to click on it.
I added new columns C and D
C2 =IF($A2="","",SUMIF(Expenses::A,REGEX(" - "&$A2),Expenses::D))
D2 =IF($A2="","",Expenses::E$7)
E2 =IF($A2="",0,C2+D2−B2)
Fill down with those to complete the columns
C looks for " - " followed by the person's name in each expense name and sums those expenses.
D is simply a copy of the total from the Expenses table.
E is amount owed minus amount paid
G1 =OFFSET($A$1,COLUMN()−6,0)
Fill right to complete the header row
G2 =IF(OR(G$1="",$A2=""),"",MAX(XLOOKUP(G$1,$A,$E)×$F2,0))
Fill across and down to complete the table
You may have to change some formatting and get rid of the conditional highlighting and custom format in the new columns.
I used Copy Style and Paste Style to get the "owed/due" format into G2 and that whole grid of cells.
I did not test this extensively. I hope I got it all correct.