The bug was that the JUNOS used to allocate IP address from other pool in chain without validating avilable addresses space from its former pools. Now with the PR fix, here is expected behaviour:
For instance, In a 13 linked pool chain, say each pool has 15 addresses. Total of about 195 addresses.
1. Take 60 PPPoE subscribers that will take the first 15 IP Addresses from first pool:
>followed another 15 addresses from the second linked pool,
>followed by another 15 addresses from third linked pool,
>followed by another 15 addresses from forth linked pool.
2. Disconnect 4 subscribers from second pool range, & 3 subscribers from third pool.
>Upon reconnect, all the 7 subscribers gets IP from the second & third pool.
3. Disconnect 3 subscribers from third pool range, & 4 subscribers from forth pool:
>Upon reconnect, all the 7 subscribers gets IP from the third & forth pool.
4. Disconnect 5 subscribers from first pool:
>Upon reconnect, all 5 subscribers get IP from first pool.
By default, the matching pool is searched first, then the search moves to the first pool in the chain and proceeds through the chain until an available address is found and allocated, or until the search determines no addresses are free. In each pool, all address ranges are fully searched for an address. This behavior enables addresses to be assigned contiguously.
Alternatively, you can configure the linked-pool-aggregation statement to search first within a block of addresses in each range in the matching pool and then successively through the linked pools. The search then moves back to the first pool in the chain and searches all addresses in all ranges in each pool through the last pool in the chain.
For more info on the address-assignment:
https://www.juniper.net/documentation/en_US/junos/topics/concept/subscriber-management-address-assignment-pools-overview.html
Now in your case, I see your requirement is that you want use the pool name "123" only when returning VSA for certain subscribers and use pool name "XYZ" (which is linked chain) for other subscribers.
I'd suggest that for other subscribers(s), return framed-pool "XYZ" so the system always looks for pool "XYZ" and allocate address from within "XYZ". Simiarily for pool name "123". or another way would be to Terminate the subscribers in RI pick address from that isolated RI.
Another thought solution i wondered was using predefined-variable-defaults statement( of dynamic-profile ) but unfortunately it doesn't do for address-assigment/allocation.