Enumerate all possible grids of integers with constraints
APL (Dyalog), 42 bytes



{o/⍨(⍵≡+/,+⌿)¨o←3 3∘⍴¨(,o∘.,⊢)⍣8⊢o←⍳1+⌈/⍵}


Try it online!

Uses ⎕IO←0 which is default on many systems. The other stuff in the header is just pretty printing for the matrices (boxed display).

Input is list of six values, rows sums first, then column sums.

How?

o←⍳1+⌈/⍵ - o gets the range 0 to the maximum (⌈/) of input

,o∘.,⊢ - cartesian product with o and flatten (,)

⍣8 - repeated for eight times

3 3∘⍴¨ - shape every 9-items list into a 3×3 matrix

¨o← - save these matrices to o, and for each

+/,+⌿ - check if the rows sums (+/) concatenated to the column sums (+⌿)

⍵≡ - correspond with the input

o/⍨ - filter o (the matrices array) by truthy values