Regression spec for 'stack level too deep' #5384

Fixes #5384
Add in fix from @andrzejpolis Fixes #5384 Fixes #5386