In theory this does make your cap legal at 104.7m total including the savings by waiving Olofsson.
However, still a few issues that prevent this actually being legal.
1. Loustarainen is NHL contract and has to go through waivers - no issue if you want to post.
2. This one is a bit bigger issue. We allow only 3 NHL contracts to be held on waivers and you are now going to be at 4 with Olofsson and 5 if you were to waive Loustarainen:
C Jay Beagle, $3.0m (2021-2022) - 1.9m cap hit holding in minors
LW Antoine Roussel, $3.0m (2021-2022) - 1.9m cap holding in minors
LW/RW Anthony Mantha, $5.7m (2023-2024) - 4.6m cap holding in minors
LW/RW Victor Olofsson, $3.4m (2022-2023) - 2.3m cap holding in minors
C Eetu Loustarinen, $0.8m (2022-2023) (potentially) - no cap holding in minors if he were to clear
Suggestions:
1. You could buyout Beagle/Roussel at a 2m cap each vs 1.9m holding in minors so not a big difference and would be legal if you decide to buyout both and waive Loustarainen, leaving you only 3 NHL players in minors and legal cap.
2. You could buyout 1 of the 2 above as well as release Fabbri (All IR does count for cap still). Allows you to avoid waiving Loustarainen. Downside is you lose rights to resign Fabbri if this is something you wanted to do in offseason. If you do keep him you can assign a player 700k or less as replacement so cap doesn't go to waste but you may prefer just saving the cap outright given your situation.
These 2 come to mind as simple solutions, but you could always do something else or try to trade so your call.
I know this is a bit messy and also I was away most of weekend so didn't look into specific these moves until now, so see how you would like to proceed and let me know if you need further clarity.